RDF ( OWL) XPath
, @. RDF XML (, , RDF OWL), : RDF XML-. , , rdfs:label owl:Ontology, ? , .
OWL API, , Protégé. , .
<rdf:RDF xmlns="http://www.example.com/labelledOnt#"
xml:base="http://www.example.com/labelledOnt"
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://www.example.com/labelledOnt">
<rdfs:label>Here is a label on the Ontology.</rdfs:label>
</owl:Ontology>
</rdf:RDF>
RDF, , RDF/XML. RDF , , OWL. owl:Ontology XML, XPath .
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.example.com/labelledOnt#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
<rdf:Description rdf:about="http://www.example.com/labelledOnt">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Ontology"/>
<rdfs:label>Here is a label on the Ontology.</rdfs:label>
</rdf:Description>
</rdf:RDF>
RDF RDF/XML, XML.
RDF SPARQL
, RDF XPath, ? RDF SPARQL. RDF , SPARQL , .
, , . 3- [subject,predicate,object]. .
- ,
owl:Ontology. " " rdf:type, [?something,rdf:type,owl:Ontology]. - , ( )
rdfs:label . [?something,rdfs:label,?label].
SPARQL, , .
PREFIX owl: <http://www.w3.org/2002/07/owl
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema
SELECT ?label WHERE {
?ontology a owl:Ontology ;
rdfs:label ?label .
}
( , rdf:type , SPARQL a . s p1 o1; p2 o2 . s p1 o1 . s p2 o2 ..)
SPARQL , . , . , , Jena arq, .
$ arq --data labelledOnt.owl --query getLabel.sparql
--------------------------------------
| label |
======================================
| "Here is a label on the Ontology." |
--------------------------------------