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:
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
Object Can Be Literal. "24". Note: noun form "age" preferred to the verb style "knows" for predicates
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)
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.
Data …e.g. a table "24"; "blue". "3"; "green". "5"; "green". ageeyecolor pat24blue al3green jo5green
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" ].
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
Local Concept <> "A simple example of N3". Who or what knows what is?
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 "#"
Assumed Prefixes In this tutorial: @prefix rdf:. @prefix rdfs:. @prefix owl:. and also @prefix :. e.g. :pat :child [ :age "4" ], [ :age "3" ].
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
Cont. Equivalent: :Person rdf:type rdfs:Class :Person a rdfs:Class. Which we could use with data: :Pat a :Person.
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
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
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.
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
N3 @prefix :. @prefix bio:. @prefix per:. :pat a bio:Human; per:name "Pat Smith", "Patrick Smith"; per: pet [ a bio:Dog; per:name "Rover" ].