Semantic Web(Web 3.0) SPARQL

Download Semantic Web(Web 3.0) SPARQL

Post on 11-May-2015

3.534 views

Category:

Technology

5 download

Embed Size (px)

DESCRIPTION

Semantic Web(Web 3.0) SPARQL

TRANSCRIPT

<ul><li>1.Web 3.0 SPARQL / XML QueryPresenter Um Dae jin (mrumx@naver.com) Internet Technology Graduate school of information &amp; Telecommunications in KONKUK University </li></ul> <p>2. AgendaIntroduction RDF &amp; SPARQL SPAR Query Language Get the Knowledge Term | Syntax | Pattern | Constraint Simple protocol SPARQL 1.1 3. Introduction 4. RDF, SPARQL 5. RDF(Resource Description Framework)Resource Description Framework () !!! Resource : URI (,, ) Description : Resource , , Framework : , , 6. RDF(Resource Description Framework) Subject Predicate Object (Resource) (Property, Relation) (Resource, Literal)URI URIURI Blank Node Literal This is the Framework!!! 7. RDF(Resource Description Framework) ~!!! (Blog), (RSS), , (FOAF) etc ~!!! 8. PingtheSemanticWeb.com is a repository for RDF documents.http://pingthesemanticweb.com/ RDF(Resource Description Framework)These namespaces are used to describe entities in X number of documents 2009.11.232008.7.162008.11.04 2009.1.8 9. PictureMusic PersonDictionary Region SPARQL GRDDL(Gleaning Resource Descriptions from Dialects of Languages) 10. SPARQL Simple Protocol And RDF Query Language 11. Simple Protocol http://semantic.lab.konkuk.ac.kr/rdf/endpoint/sparql?select RDF SELECT ?email WHERE { ?user :email ?email. ?user :name umdaejin; } r2mailto:bob@work.example.com &amp; RDF Query Language RDF Query language is the pattern matched SPO(Subject, Predicate, Object) in Graph 12. SPARQL is Query Language and a protocol for accessing RDF 13. SPA RDF Query Language 14. Query Language 15. SQL vs. SPARQL SELECT name FROM users WHERE contact=010-3333-7777;SELECT ?nameReturn Variables WHERE { ?user rdf:type :User. ?user :name ?name. SPO Pattern ?user :contact 010-3333-7777. } FROM Graph Source 16. Graph &gt; Query Language &gt; Binding &gt; Protocol rdf:type SELECT ?name _person foaf:Person WHERE { ?user rdf:type :foaf:Person.:contact ?user :contact 010-3333-7777. :name010-3333-7777 ?user :name ?name. } FROM umdaejinRDF ?name = umdaejin umdaejin 17. SPARQL BASE PREFIX rdf: PREFIX foaf: PREFIX ex: SELECT DISTINCT $person ?name $age FROM FROM WHERE {$person a foaf:Person; foaf:name ?name.OPTIONAL {$person ex:age $age }.FILTER (!REGEX(?name, Bob)) } ORDER BY ASC(?name) LIMIT 10 OFFSET 20 * SPARQL RDF Query Language Reference V1.8 by Dave Beckett. 18. Get the Knowledge TERMS SyntaxPattern 19. Terms IRI : URI reference within an RDF graph //base URI foaf:name //prefix URI, PREFIX #x00 (X) //UNICODE Datatype IRI : datatype URI Plain Literal : lexical form, optionally language tag, @ko Semantic web , @koTyped Literal : lexical form, datatype URI 30^^xsd:integer daejin^^http://www.w3.org/2001/XMLSchema#stringBlank node : dummy node, node , _:a, _n06968595988 20. Terms NameSpace : Vocabulary URI http://www.w3.org/1999/02/22-rdf-syntax-ns# http://purl.org/dc/elements/1.1/ http://xmlns.com/foaf/0.1/ Prefix : URI rdf, dc, foaf RDF Graph : A Set of RDF TriplesRDF Triple : S-P-O Subject : URI, Qname, Blank Node, Literal, Variable Predicate : URI, Qname, Blank node, Variable Object : URI, Qname, Blank node, Literal, Variable 21. Terms Match : Graph SPO Query Pattern Match Solutions : Match ?x = Query Variable : Solutions ?x or $name 22. Play# umdaejin email? :email _person mrumx@naver.com :name SELECT ?email WHERE { ?person :email ?email. umdaejin ?person :name umdaejin; } 23. Syntax - RDF Term Syntax LiteralsHi Korea //Hi Korea Hi Korea@en // Hi Korea^^xsd:string // etc. integer, boolean1 == 1^^xsd:integertrue == true^^xsd:boolean1.3 == 1.3^^xsd:decimal 24. Play #umdaejin email?:email _person mrumx@naver.com :name SELECT ?email umdaejin@en WHERE { ?person :name umdaejin@en. ?person :email ?email. } 25. Syntax - RDF Term Syntax IRIBASE PREFIX book: book:book1 26. Syntax -Triple Pattern Syntax PREFIX, BASE PREFIX dc: SELECT ?title WHERE { dc:title ?title }PREFIX dc: PREFIX : SELECT $title WHERE { :book1 dc:title $title }BASE PREFIX dc: SELECT $title WHERE { dc:title $title } 27. Play # daejin ? :like _personBook:book_3:namebook:name daejin@enANT BASE PREFIX book:http://example.org/book/&gt; SELECT ?book_name WHERE { ?person :like book:book_3. book:book_3 book:name ?book_name. } 28. Syntax - RDF Term Syntax Query Var ?var or $varBlank [ :p v]. == [] :p v.Unique Blank - IRI _b57 :p v. // [ foaf:name ?name ; foaf:mbox ] / / _b11 foaf:name ?name ; S PO . _b11 foaf:mbox 29. Play # foaf:name umdaejin name? :love _a_bfoaf:namename umdaejin sunyoung PREFIX foaf: . PREFIX : . SELECT $name WHERE { ?_a foaf:name umdaejin. ?_a :love $_b. $_b $name. } 30. Syntax ; , ?people foaf:name ?name ; foaf:mbox ?mbox . ~ ?people foaf:name ?name . ?people foaf:mbox ?mbox . ?people foaf:nick "Alice" , "Alice_" . ~ ?people foaf:nick "Alice" . ?people foaf:nick "Alice_" . 31. Play # umdaejin ? foaf:knows _a_b foaf:nicknamefoaf:namefoaf:name umdaejinSangWonPREFIX foaf: .SELECT ?nameWHERE {?_a foaf:nickname ; foaf:name umdaejin.?_a foaf:knows ?_b.?_b foaf:name ?name.} 32. Pattern Basic Graph Pattern {?people foaf:name umdaejin".}Group Graph Pattern { {?people foaf:name umdaejin".} {?people foaf:email umdaejin@gmail.com".} } // Filter { ?people foaf:name ?name. FILTER regex (?name, um) } 33. PatternOptional Graph Pattern _:a rdf:type foaf:Person . _:a foaf:name "Alice" . _:a foaf:mbox . _:a foaf:mbox . _:b rdf:type foaf:Person . _:b foaf:name "Bob" . SELECT ?name ?mbox WHERE { ?people foaf:name ?name . OPTIONAL { ?people foaf:mbox ?mbox } } 34. Pattern Optional Graph Pattern + FILTERSELECT ?people ?mboxWHERE {?people foaf:name ?name .OPTIONAL { ?people foaf:mbox ?mbox .FILTER regex(?mbox, @gmail)}} //OPTIONAL Alternative Graph PatternSELECT ?people ?mbox{?people foaf:name ?name . ?people foaf:knows ?name}WHERE { UNION{?people foaf:name ?name .} {? people naver:name ?name. ?people naver:knows ?name}UNION{?people naver:name ?name .}}//UNON 35. Constraint String Value Constraint SELECT ?people, ?name WHERE { ?people :name ?name FILTER regex(?name, ^um, i) } // um Numeric Value Constraint SELECT ?people, ?age WHERE { ?people :age ?age. FILTER (?age &gt; 30) } // 30 36. Play # 35 35 ? foaf:knows_a _b:age foaf:name:agefoaf:name 36Dongbum 35 SangWon PREFIX foaf: .PREFIX : .SELECT ?nameWHERE {?_a :age ?age.?_a :age ?age.FILTER ( ?age &gt;= 35 ) ?_a foaf:knows ?_b.?_a foaf:knows ?_b. ?_b :age ?b_age;?_b :age ?b_age;foaf:name ?name. foaf:name ?name. FILTER ( ?age &gt;= 35 )FILTER ( ?b_age 18) AS over 18 WHERE {?person :name ?name ; :age ?age . } Existing implementation. Garliks JXT, Dave Becketts Redland, ARQ, Virtuoso, Open Anzos Glitter SPARQL Engine, XSPARQL Status. Required 53. Update Ex. INSERT DATA { :book1 dc:title new book; dc:creator someone. }DELETE { ?book ?p ?v } WHERE { ?book dc:date ?date . FILTER ( ?date &lt; 2001-01-01T00:00:00^^xsd:dateTime ) ?book ?p ?v. }Existing implementation. ARQ, Virtuoso Status.Required Update with HTTP PUT, DELETE Existing implementation. Garliks JXT, IBMs Jazz Foundation 54. Aggregate Functions Garliks JXT Subqueries Dave Becketts RedlandNegationARQ Projection Expressions Open Anzos Glitter Service descriptionVirtuoso Update (REST)ARC SeRQLRDF::QuerySQLXSPARQL IBMs Jazz Foundation * WG , . 55. Links http://groups.google.com/group/semanticwebstudy?hl=kohttp://delicious.com/kwangsub.kim/bundle:RDFTutorial2009SPARQL (IBM DevWorks) : http://www.ibm.com/developerworks/kr/library/tutorial/x-sparql/SPARQL Working Group : http://www.w3.org/2009/sparql/wiki/Main_Page 56. Thanks </p>

Recommended

View more >