OWL API를 처음 사용하여 실험을 시도했습니다. OWL API를 사용하여 Eclipse에서 protge 및 상호 응용 프로그램에 간단한 온톨로지를 만들었습니다. 다음과 같이 온톨로지 구조는 다음과 같습니다 - 다음과 같이속성 값 가져 오기 OWL API를 사용하는 온톨로지에서 두 객체의 교차점
----------------------------------------------------------------------------------------
Class Object (Data Property)StringValue ObjectProperty relatedTo
----------------------------------------------------------------------------------------
WordString WS1 "One" DS1
WS2 "Two" DS2
WS3 "Three" DS3
DigiString DS1 "1"
DS2 "2"
DS3 "3"
----------------------------------------------------------------------------
전체 온톨로지는 다음과 같습니다 -
<rdf:RDF xmlns="http://localhost:3030/DigiWord.owl#"
xml:base="http://localhost:3030/DigiWord.owl"
xmlns:DigiWord="http://localhost:3030/DigiWord.owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://localhost:3030/DigiWord.owl"/>
<!--
// Object Properties
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://localhost:3030/DigiWord.owl#relatedTo -->
<owl:ObjectProperty rdf:about="&DigiWord;relatedTo">
<rdfs:domain rdf:resource="&DigiWord;DigiString"/>
<rdfs:range rdf:resource="&DigiWord;WordString"/>
</owl:ObjectProperty>
<!--
//
// Data properties
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://localhost:3030/DigiWord.owl#stringValue -->
<owl:DatatypeProperty rdf:about="&DigiWord;stringValue">
<rdfs:domain rdf:resource="&DigiWord;DigiString"/>
<rdfs:domain rdf:resource="&DigiWord;WordString"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!--
// Classes
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://localhost:3030/DigiWord.owl#DigiString -->
<owl:Class rdf:about="&DigiWord;DigiString"/>
<!-- http://localhost:3030/DigiWord.owl#WordString -->
<owl:Class rdf:about="&DigiWord;WordString"/>
<!--
// Individuals
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://localhost:3030/DigiWord.owl#DS1 -->
<owl:NamedIndividual rdf:about="&DigiWord;DS1">
<rdf:type rdf:resource="&DigiWord;DigiString"/>
<stringValue rdf:datatype="&xsd;string">1</stringValue>
<relatedTo rdf:resource="&DigiWord;WS1"/>
</owl:NamedIndividual>
<!-- http://localhost:3030/DigiWord.owl#DS2 -->
<owl:NamedIndividual rdf:about="&DigiWord;DS2">
<rdf:type rdf:resource="&DigiWord;DigiString"/>
<stringValue rdf:datatype="&xsd;string">2</stringValue>
<relatedTo rdf:resource="&DigiWord;WS2"/>
</owl:NamedIndividual>
<!-- http://localhost:3030/DigiWord.owl#DS3 -->
<owl:NamedIndividual rdf:about="&DigiWord;DS3">
<rdf:type rdf:resource="&DigiWord;DigiString"/>
<stringValue rdf:datatype="&xsd;string"></stringValue>
<relatedTo rdf:resource="&DigiWord;WS3"/>
</owl:NamedIndividual>
<!-- http://localhost:3030/DigiWord.owl#WS1 -->
<owl:NamedIndividual rdf:about="&DigiWord;WS1">
<rdf:type rdf:resource="&DigiWord;WordString"/>
<stringValue rdf:datatype="&xsd;string">One</stringValue>
</owl:NamedIndividual>
<!-- http://localhost:3030/DigiWord.owl#WS2 -->
<owl:NamedIndividual rdf:about="&DigiWord;WS2">
<rdf:type rdf:resource="&DigiWord;WordString"/>
<stringValue rdf:datatype="&xsd;string">Two</stringValue>
</owl:NamedIndividual>
<!-- http://localhost:3030/DigiWord.owl#WS3 -->
<owl:NamedIndividual rdf:about="&DigiWord;WS3">
<rdf:type rdf:resource="&DigiWord;WordString"/>
<stringValue rdf:datatype="&xsd;string">Three</stringValue>
</owl:NamedIndividual>
</rdf:RDF>
내가 문자열 "1"제공에 DS2 예에 대한 DS1, WS2에 대한 개체 WS1를 검색하고 싶다 "2 "등 내 코드는 각각"One ","Two "를 검색해야합니다. net에서 어떤 유형의 관련 코드도 발견하지 못했습니다. 모든 도움을 주시면 감사하겠습니다. 미리 감사드립니다.
그것은 당신의 온톨로지가 어떻게 생겼는지 매우 분명하지 않다. 맨체스터 또는 함수 구문에 공리를 추가 할 수 있습니까? – mikrohelen
@mikrohelen 선생님, 완전한 온톨로지를 사용하셨습니다. 감사. – learner