こんにちは、protege(.owl ファイル) を使用してオントロジーを作成しました。これを Java プログラム (Eclipse で jena を使用) にインポートし、そのインスタンスを作成したいと考えています (つまり、私のオントロジーは一般的なものを表しているということです。インスタンスは特定の状態を表す必要があります。) インポートと作成が必要です。
後で、ユーザー入力 (インスタンスを含むファイル) を比較し、そのインスタンスの状態を出力する予定です。
私はこれが初めてで、非常に新しいです。だから、すべての助けに感謝します。
ありがとうございました
owl ファイルの内容は次のとおりです。
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY Ontology1365003423152 "http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#" >
]>
<rdf:RDF xmlns="http://www.w3.org/2002/07/owl#"
xml:base="http://www.w3.org/2002/07/owl"
xmlns:Ontology1365003423152="http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#">
<Ontology rdf:about="http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Datatypes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#HasDuration -->
<DatatypeProperty rdf:about="&Ontology1365003423152;HasDuration">
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
<rdfs:domain rdf:resource="&Ontology1365003423152;Attack"/>
<rdfs:range rdf:resource="&xsd;positiveInteger"/>
</DatatypeProperty>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#HasFlag -->
<DatatypeProperty rdf:about="&Ontology1365003423152;HasFlag">
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
<rdfs:domain rdf:resource="&Ontology1365003423152;Attack"/>
<rdfs:range rdf:resource="&xsd;string"/>
</DatatypeProperty>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#HasProtocol -->
<DatatypeProperty rdf:about="&Ontology1365003423152;HasProtocol">
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
<rdfs:domain rdf:resource="&Ontology1365003423152;Attack"/>
<rdfs:range rdf:resource="&xsd;string"/>
</DatatypeProperty>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#HasService -->
<DatatypeProperty rdf:about="&Ontology1365003423152;HasService">
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
<rdfs:domain rdf:resource="&Ontology1365003423152;Attack"/>
<rdfs:range rdf:resource="&xsd;string"/>
</DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#0 -->
<Class rdf:about="&Ontology1365003423152;0">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackDuration"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#1 -->
<Class rdf:about="&Ontology1365003423152;1">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackDuration"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#2 -->
<Class rdf:about="&Ontology1365003423152;2">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackDuration"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#6 -->
<Class rdf:about="&Ontology1365003423152;6">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackDuration"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Attack -->
<Class rdf:about="&Ontology1365003423152;Attack"/>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#AttackDuration -->
<Class rdf:about="&Ontology1365003423152;AttackDuration"/>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#AttackFlag -->
<Class rdf:about="&Ontology1365003423152;AttackFlag"/>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#AttackProtocolType -->
<Class rdf:about="&Ontology1365003423152;AttackProtocolType"/>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#AttackService -->
<Class rdf:about="&Ontology1365003423152;AttackService"/>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Domain_u -->
<Class rdf:about="&Ontology1365003423152;Domain_u">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Eco_i -->
<Class rdf:about="&Ontology1365003423152;Eco_i">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Ecr_i -->
<Class rdf:about="&Ontology1365003423152;Ecr_i">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Finger -->
<Class rdf:about="&Ontology1365003423152;Finger">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Ftp_data -->
<Class rdf:about="&Ontology1365003423152;Ftp_data">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Http -->
<Class rdf:about="&Ontology1365003423152;Http">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Icmp -->
<Class rdf:about="&Ontology1365003423152;Icmp">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackProtocolType"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Mailbomb -->
<Class rdf:about="&Ontology1365003423152;Mailbomb">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;Attack"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#NoAttack -->
<Class rdf:about="&Ontology1365003423152;NoAttack">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;Attack"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Private -->
<Class rdf:about="&Ontology1365003423152;Private">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#SF -->
<Class rdf:about="&Ontology1365003423152;SF">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackFlag"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Smtp -->
<Class rdf:about="&Ontology1365003423152;Smtp">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackService"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Smurf -->
<Class rdf:about="&Ontology1365003423152;Smurf">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;Attack"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Tcp -->
<Class rdf:about="&Ontology1365003423152;Tcp">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackProtocolType"/>
</Class>
<!-- http://www.semanticweb.org/ontologies/2013/3/Ontology1365003423152.owl#Udp -->
<Class rdf:about="&Ontology1365003423152;Udp">
<rdfs:subClassOf rdf:resource="&Ontology1365003423152;AttackProtocolType"/>
</Class>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.2.3.1824) http://owlapi.sourceforge.net -->