notation 3(n3)
DESCRIPTION
Presentation on N3 for Semantic Web.TRANSCRIPT
Notation 3(N 3)Presented By
Yogendra Tamang070-MSCS-670
Outline
• Introduction• Square Brackets• Sharing Concepts• Making Vocabularies• Equivalence• Publishing• References
Introduction• RDF just collection of objects in subject, verb and object form
• Everything represented by URI• Object may be literal
• More readable
<#Ram> <#Knows> <#Sita>
<#Ram> <#age> 25.
<#pat> has <#child> <#jo>.
<#jo> is <#child> of <#pat>.
Introduction
• Several statements about same subjectsSemicolon (;) : describing property of same subject.Comma(,) : Another object with same predicate and subject.
<#pat> <#child> <#al>, <#chez>, <#jo>; <#age> 24;
<#eyecolor> “blue”.
Example:
Age Eye ColorRam 24 blueHari 28 greenShyam 6 green
<#Hari> <#age> 24;<#eyecolor> “blue”.<#Ram> <#age> 28;<#eyecolor> “green”.<#Ram> <#age> 6;<#eyecolor> “green”.
Square Braces [ ]
• Something exists with given properties but don't give you a way to refer to it elsewhere in this or another document
• Example<#pat> <#child> [<#age> 4, <#age> 3].
Square Braces []
• Futher
[<#name> “Ram"; <#age> 24; <#eyecolor> "blue" ]. [<#name> “Hari" ; <#age> 28; <#eyecolor> "green" ].
[<#name> “Shyam" ; <#age> 6; <#eyecolor> "green" ].
Sharing concepts
• Semantic Web Can not define in one document what something means.• Uses URI for concepts<> <#title> “Semantic Web Introduction”.• N3 allows a shorthand prefix for long part namespace• <>< http://purl.org/dc/element/1.1/title > “Semantic Web
Introduction”
@prefix dc: <http://purl.org/dc/element/1.1><> dc:title “Semantic Web Introduction”
Conventions on using prefix
• Use colon and dc and titile• No angular brackets• Prefix can be used for rest of file
Well known namespaces@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl:
<http://www.w3.org/2002/07/owl#> .
Writing Data
• @prefix: <#> Document itself
:pat :child [:age 4], [:age 3].
Making Vocabularies
• Define new classes of things and new properties• What type of thing is X ???• Answer: X belongs to “ClassName”• Property what type of something is ? Rdf:type a** Define a class “Person”
:Person a rdfs:class.** Create a object of class Person
:pat a :Person.
Making Vocabularies
• An object may be of many classes• Example:Woman a rdfs:Class; rdfs:SubClassOf :Person.
• Property declares relationship between two things• Example:sister a rdf:Property
Domain and Range
• When subject of property must be in a class, that class is domain of the property
• When object must be in a class that class is range of property:sister rdfs:domain :Person;
rdfs:range :Woman.
Class identifiers start with capitals and properties small letters
Equivalence
• One or more terms in one vocabulary may be same in another vocabulary
• Very Useful:Woman=foo:FemaleAdult:Title a rdf:Property;=dc:title.
• Interchange of Data
Choosing Namespace and Publishing your Vocabulary• RDF Schema and OWL Vocabularies Machine Readable• Create URI as vocabulary terms that work on browsers
ex: http://example.com/terms • Publish on server and portion of URI space of organization that
commit to maintain on future too..
Shorthand for common predicates
a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
= <http://www.w3.org/2002/07/owl#sameAs>
=> <http://www.w3.org/2000/10/swap/log#implies>
<= <http://www.w3.org/2000/10/swap/log#implies> but in the inverse direction
Example• There is person, Pat, known as "Pat Smith" and "Patrick Smith". Pat
has a pet dog named "Rover".
@prefix : <http://www.w3.org/2000/10/swap/test/demo1/about-pat#> .@prefix bio: <http://www.w3.org/2000/10/swap/test/demo1/biology#> . @prefix per: <http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#>.:pat a bio:Human;
per:name "Pat Smith", "Patrick Smith";per:pet [ a bio:Dog; per:name "Rover"
] .
Directed Labeled Graph
References
• http://www.w3.org/2000/10/swap/doc/• http://www.csee.umbc.edu/courses/graduate/691/spring13/01/pape
rs/n3logic-tplp.pdf• http://www.w3.org/2000/10/swap/doc/cwm.html• http://www.w3.org/TeamSubmission/2011/SUBM-n3-20110328/