notation 3(n3)

19

Click here to load reader

Upload: yogendra-tamang

Post on 14-May-2015

51 views

Category:

Education


0 download

DESCRIPTION

Presentation on N3 for Semantic Web.

TRANSCRIPT

Page 1: Notation 3(n3)

Notation 3(N 3)Presented By

Yogendra Tamang070-MSCS-670

Page 2: Notation 3(n3)

Outline

• Introduction• Square Brackets• Sharing Concepts• Making Vocabularies• Equivalence• Publishing• References

Page 3: Notation 3(n3)

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>.

Page 4: Notation 3(n3)

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”.

Page 5: Notation 3(n3)

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”.

Page 6: Notation 3(n3)

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].

Page 7: Notation 3(n3)

Square Braces []

• Futher

[<#name> “Ram"; <#age> 24; <#eyecolor> "blue" ]. [<#name> “Hari" ; <#age> 28; <#eyecolor> "green" ].

[<#name> “Shyam" ; <#age> 6; <#eyecolor> "green" ].

Page 8: Notation 3(n3)

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”

Page 9: Notation 3(n3)

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#> .

Page 10: Notation 3(n3)

Writing Data

• @prefix: <#> Document itself

:pat :child [:age 4], [:age 3].

Page 11: Notation 3(n3)

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.

Page 12: Notation 3(n3)

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

Page 13: Notation 3(n3)

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

Page 14: Notation 3(n3)

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

Page 15: Notation 3(n3)

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..

Page 16: Notation 3(n3)

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

Page 17: Notation 3(n3)

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"

] .

Page 18: Notation 3(n3)

Directed Labeled Graph

Page 19: Notation 3(n3)

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/