Presentation is loading. Please wait.

Presentation is loading. Please wait.

RDF using N3. Subject, Verb and Object All knowledge is just a set of statements. Everything is identified by URI Here a local URI but could point to.

Similar presentations


Presentation on theme: "RDF using N3. Subject, Verb and Object All knowledge is just a set of statements. Everything is identified by URI Here a local URI but could point to."— Presentation transcript:

1 RDF using N3

2 Subject, Verb and Object All knowledge is just a set of statements. Everything is identified by URI Here a local URI but could point to ANY document Verb known as predicate in the statement and represents a Property. The period at the end – very important

3 Object Can Be Literal. "24". Note: noun form "age" preferred to the verb style "knows" for predicates

4 Alternative Forms has. Just to make reading easier; no meaning is of. is and of reverse the direction Saves having inverse relationships for everything (eg parent)

5 Comma and Semicolon,, ; "24" ; "blue". Comma: delimits multiple objects for same subject & predicate Semicolon: delimits multiple predicates for same subject. Aim? Easy scribbling of data.

6 Data …e.g. a table "24"; "blue". "3"; "green". "5"; "green". ageeyecolor pat24blue al3green jo5green

7 Unnamed Things: Square Brackets [ "4" ], [ "3" ]. Words used as IDs have no actual meaning Unnamed nodes can't be used elsewhere ID things are names; make the name explicit [ "Pat"; "24"; "blue" ]. [ "Al" ; "3"; "green" ]. [ "Jo" ; "5"; "green" ].

8 Sharing Concepts Using the same URIs is effort but valuable For anything -- including predicates URIs tend to be long so we use namespaces Writing authoritative documents about shared concepts is useful

9 Local Concept <> "A simple example of N3". Who or what knows what is?

10 Shared Concept "Primer - Getting into the Semantic Web and RDF using N3". @prefix dc:. <> dc:title "Primer - Getting into the Semantic Web and RDF using N3". No <> used when prefixed identifier Typically prefix stands for everything up to including a "#"

11 Assumed Prefixes In this tutorial: @prefix rdf:. @prefix rdfs:. @prefix owl:. and also @prefix :. e.g. :pat :child [ :age "4" ], [ :age "3" ].

12 RDF Conversion

13 Making Vocabularies A set of shared concepts Properties are things to use as predicates (verbs) Classes can be the type of an object rdf:type is just a property, abbreviated to "a" in N3

14 Cont. Equivalent: :Person rdf:type rdfs:Class :Person a rdfs:Class. Which we could use with data: :Pat a :Person.

15 Classes An object can be in many classes Classes can have many superclasses You can never know all the classes an object is in These are classes of real things, not OO classes

16 Examples: class and property :Woman a rdfs:Class; rdfs:subClassOf :Person. :sister a rdf:Property. Something about the Property :sister :: :sister rdfs:domain :Person; rdfs:range :Woman. Use: :Pat :sister :Jo. Class ids start with capital, Propoerty ids with lowercase

17 Best Practice Use other people's terms when you can Use your own when you need to Be prepared to declare them equivalent later = in N3 is short for owl:equivalentTo :Woman = foo:FemaleAdult. :title a rdf:Property; = dc:title.

18 Examples English (Very Informal): There is person, Pat, known as "Pat Smith" and "Patrick Smith". Pat has a pet dog named "Rover". English Hypertext (Informal): Ambiguity of terms is removed by links PatPat is a human with the names "Pat Smith" and "Patrick Smith". Pat has a pet, a dog, with the name "Rover".is ahumannamesPat petadogname

19 N3 @prefix :. @prefix bio:. @prefix per:. :pat a bio:Human; per:name "Pat Smith", "Patrick Smith"; per: pet [ a bio:Dog; per:name "Rover" ].

20 Directed Labeled Graph

21 RDF Translation <rdf:RDF xmlns="http://www.w3.org/2000/10/swap/test/demo1/abo ut-pat#" xmlns:bio="http://www.w3.org/2000/10/swap/test/demo1/ biology#" xmlns:per="http://www.w3.org/2000/10/swap/test/demo1/f riends-vocab#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#">

22 Cont. Pat Smith Patrick Smith Rover

23 END


Download ppt "RDF using N3. Subject, Verb and Object All knowledge is just a set of statements. Everything is identified by URI Here a local URI but could point to."

Similar presentations


Ads by Google