
Understanding RDF and Turtle in Semantic Web Topics
Explore the concepts of RDF (Resource Description Framework) and Turtle syntax in the context of Semantic Web topics. Learn about RDF/XML, default namespaces, nesting descriptions, typed nodes, and more through practical examples. Enhance your knowledge of semantic web technologies with clear explanations and visual aids.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CSE 428 Semantic Web Topics RDF Jeff Heflin Lehigh University
Turtle vs. RDF/XML Turtle: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . <http://www.yahoo.com/~jdoe#jane> foaf:name "Jane Doe" ; foaf:knows <http://www.yahoo.com/~jsmith#john> . RDF/XML: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <rdf:Description rdf:about="http://www.yahoo.com/~jdoe#jane"> <foaf:knows rdf:resource="http://www.yahoo.com/~jsmith#john" /> <foaf:name>Jane Doe</foaf:name> </rdf:Description> </rdf:RDF>
Default Namespaces <rdf:RDF xmlns="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="http://www.yahoo.com/~jdoe#jane"> <knows rdf:resource="http://www.yahoo.com/~jsmith#john" /> <name>Jane Doe</name> </rdf:Description> </rdf:RDF>
Using XML Entities <!DOCTYPE rdf:RDF [ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">] > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" > <rdf:Description rdf:about="http://www.aol.com/~jdoe"> <foaf:age rdf:datatype="&xsd;integer">30</foaf:age> </rdf:Description> </rdf:RDF> Resolves to: http://www.w3.org/2001/XMLSchema#integer
Nesting Descriptions <rdf:RDF xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="http://www.aol.com/~jdoe"> <foaf:name>Jane Doe</foaf:name> <foaf:knows> <rdf:Description rdf:about="http://www.aol.com/~jsmith"> <foaf:name>John Smith</foaf:name> </rdf:Description> </foaf:knows> </rdf:Description> </rdf:RDF>
Typed Nodes in RDF/XML <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <rdf:Description rdf:about="http://www.yahoo.com/~jdoe#jane"> <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" /> <foaf:name>Jane Doe</foaf:name> </rdf:Description> </rdf:RDF> Jane is an instance of Person <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <foaf:Person rdf:about="http://www.yahoo.com/~jdoe#jane"> <foaf:name>Jane Doe</foaf:name> </foaf:Person> </rdf:RDF> Shorthand for the same thing
JSON-LD 1.1 (CR) { @context : { foaf : http://xmlns.com/foaf/0.1/ }, @id : http://www.yahoo.com/~jdoe#jane , @type : foaf:Person , foaf:name : "Jane Doe , foaf:knows : { @id : http://www.yahoo.com/~jsmith#john } } 8
RDF Schema Example <rdf:RDF xml:base="http://example.org/univ-ont#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:univ="http://example.org/univ-ont#"> <rdf:Property rdf:about="#teaches"> <rdfs:domain rdf:resource="#Professor" /> <rdfs:range rdf:resource="#Course" /> </rdf:Property> <univ:Person rdf:about="#heflin" > <univ:teaches rdf:resource="#cse428" /> </univ:Person> </rdf:RDF> rdf:Property rdf:type rdfs:domain Professor teaches heflin cse428 teaches Course rdfs:range