Knowledge Representation RDF Turtle Namespace Jan Pettersen Nytun, UiA 1
URIs Identify Web Resources Web addresses are the most common URIs, i.e., uniform Resource Locators (URLs). RDF resources are usually named by URI references (URIrefs). URIref = URI + optional fragment identifier at the end. E.g., http://www.example.org/people#tom were http://www.example.org/people = URL tom = fragment identifier http://www.example.org/people# = namespace Jan Pettersen Nytun, UIA, page 2
Full URLs are long. We can define a namespace prefix so we don t have to write the long common part of the URI. @prefix rdf: <http://www.w3.org/1999/02/22-rdfsyntax-ns#>. <http://www.uia.no/janpettersen/pet> rdf:type owl:ntology. Jan Pettersen Nytun, UiA, page 3
tandard Namespace For RDF Predefined Terms rdf: Indicates identifiers used in RDF. The set of RDF identifiers is small. The global URI for the rdf namespace is: http://www.w3.org/1999/02/22-rdf-syntax-ns# If you open http://www.w3.org/1999/02/22-rdf-syntax-ns (e.g., in Internet Explorer) you may see the list of RDF identifiers. Jan Pettersen Nytun, UIA, page 4
imple Example Jan Pettersen Nytun, UiA, page 5
@prefix : <http://www.uia.no/janpettersen/pet#>. @prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix xml: <http://www.w3.org/xml/1998/namespace>. @prefix xsd: <http://www.w3.org/2001/xmlchema#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @base <http://www.uia.no/janpettersen/pet>. <http://www.uia.no/janpettersen/pet> rdf:type owl:ntology. ################################################################# # Classes ################################################################# ### http://www.uia.no/janpettersen/pet#omeclass :omeclass rdf:type owl:class. Jan Pettersen Nytun, UiA, page 6
aving as JN-LD [ { "@id" : "http://www.uia.no/janpettersen/pet", "@type" : [ "http://www.w3.org/2002/07/owl#ntology" ] }, { "@id" : "http://www.uia.no/janpettersen/pet#omeclass", "@type" : [ "http://www.w3.org/2002/07/owl#class" ] } ] Jan Pettersen Nytun, UiA, page 7
Any URI identifier starting with : will be in the default namespace. Jan Pettersen Nytun, UiA, page 8
Protégé automatically defines a default namespace corresponding to the IRI of the ontology. @prefix : <http://www.uia.no/janpettersen/pet#>. @prefix owl: <http://www.w3.org/2002/07/owl#>. @base <http://www.uia.no/janpettersen/pet>. ### http://www.uia.no/janpettersen/pet#omeclass :omeclass rdf:type owl:class. Here the default namespace is used. Jan Pettersen Nytun, UiA, page 9
The @base Directive The @base directive sets the base URI to be used for the parsing of relative URIs. Jan Pettersen Nytun, UiA, page 10
Assume: @prefix : <http://www.uia.no/janpettersen/pet#>. @prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix xml: <http://www.w3.org/xml/1998/namespace>. @prefix xsd: <http://www.w3.org/2001/xmlchema#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @base <http://www.uia.no/testing/>. <http://www.uia.no/janpettersen/pet> rdf:type owl:ntology. :omeclass rdf:type owl:class. <TestClass> rdf:type owl:class. How will these be resolved? Jan Pettersen Nytun, UiA, page 11
Continue @prefix : <http://www.uia.no/janpettersen/pet#>. @base <http://www.uia.no/testing/>. :omeclass rdf:type owl:class. <TestClass> rdf:type owl:class. JN-DL utput: [ { "@id" : "http://www.uia.no/janpettersen/pet", "@type" : [ "http://www.w3.org/2002/07/owl#ntology" ] }, { "@id" : "http://www.uia.no/janpettersen/pet#omeclass", "@type" : [ "http://www.w3.org/2002/07/owl#class" ] }, { "@id" : "http://www.uia.no/testing/testclass", "@type" : [ "http://www.w3.org/2002/07/owl#class" ] } ] Jan Pettersen Nytun, UiA, page 12
It seems @base can not be set in Protégé; it is automatically set to the same as the ntology IRI Jan Pettersen Nytun, UiA, page 13
Merging Graphs [3]: When is a node in one graph the same node as a node in another graph? In RDF, this is solved through the use of Uniform Resource Identifiers (URIs). Jan Pettersen Nytun, UIA, page 14
Graph Merging The application is quite simple: A node from one graph is merged with a node from another graph exactly, if they have the same URI. [ref. emanueledellavalle.org]: Jan Pettersen Nytun, UIA, page 15
RDF Identifier rdf:type [Ref. http://www.w3.org/tr/2014/rec-rdf-schema-20140225/]: Jan Pettersen Nytun, UIA, page 16
rdf:type in http://www.w3.org/1999/02/22-rdf-syntax-ns rdf:type is mostly being described by RDF constructs, e.g., rdfs:domain. Jan Pettersen Nytun, UIA, page 17