Presentation is loading. Please wait.

Presentation is loading. Please wait.

RDF and RDF Schema Raúl García-Castro, Óscar Corcho, Daniel Vila-Suero

Similar presentations


Presentation on theme: "RDF and RDF Schema Raúl García-Castro, Óscar Corcho, Daniel Vila-Suero"— Presentation transcript:

1 RDF and RDF Schema Raúl García-Castro, Óscar Corcho, Daniel Vila-Suero
Ontology Engineering Group Universidad Politécnica de Madrid, Spain

2 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

3 RDF and RDF Schema RDF: Resource Description Framework Goal
To describe the semantics of information in a machine- processable way W3C recommendations Model Syntax Semantics Database XML RDF(S) Schema RDF Schema Data RDF

4 RDF(S) in the Semantic Web

5 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

6 RDF statements Also known as “triples”
[Subject, Predicate, Object] “Raúl is a member of the Ontology Engineering Group” [Raúl, is member of, Ontology Engineering Group] “Raúl’s full name is Raúl García Castro” [Raúl, has full name, Raúl García Castro] “Raúl was born on 26 December 1975” [Raúl, was born, 26 December 1975] “The Ontology Engineering Group web page is [Ontology Engineering Group, has web page, is member of Ontology Engineering Group Raúl Raúl Ontology Engineering Group has full name Raúl Raúl García Castro has birth date Raúl 26 December 1975 has web page Ontology Engineering Group

7 Ontology Engineering Group
RDF graphs RDF graphs are sets of triples has full name Raúl García Castro Raúl has birth date 26 December 1975 is member of has web page Ontology Engineering Group

8 Ontology Engineering Group
RDF literals Triple objects can be literals (character strings) Subject and predicates are always resources Literals can be typed Usually using XML Schema datatypes RDF provides the rdf:XMLLiteral datatype has full name “Raúl García Castro” Raúl has birth date “ ”^^xsd:date is member of has web page Ontology Engineering Group

9 URIs in RDF URI component parts (RFC3986) URIs in RDF:
URIs in RDF: Are URI references: URI + Fragment Can contain Unicode characters Identify resources and values (e.g., Scheme Authority Path Query Fragment “Raúl García Castro” “ ”^^xsd:date

10 Namespaces in RDF Namespaces defined using XML qualified names
URIs under a namespace are called vocabularies Prefix URI people organization properties rdf rdfs xsd properties:hasFullName “Raúl García Castro” people:Raul “ ”^^xsd:date properties:hasBirthDate properties:isMemberOf properties:hasWebPage organization:OEG

11 RDF is a URI-based vocabulary
RDF resources are identified using URIs (blank nodes are an exception) Advantages: Flexibility Self-reference Reification Disadvantages: Complexity Validation Tool support meta:created meta:Triple1 “ ”^^xsd:date meta:subject meta:object meta:creationDate meta:predicate meta:equivalentTo properties:hasFullName people:Raul “Raúl García Castro”

12 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

13 Classifying resources
The rdf:type property is used to classify resources in categories/classes The rdf:Property class is the class of all properties category:Person category:Animal Classes rdf:type rdf:type rdf:type rdf:type people:Raul people:Oscar people:Missy people:Fantasma Instances rdf:Property rdf:type rdf:type properties:hasFullName rdf:type

14 Blank nodes: structured property values
Most real-world data involves structures that are more complicated than sets of RDF triple statements This intermediate URI does not need to have a name properties:hasFullName people:Raul properties:firstName properties:lastName “Raúl” “García Castro”

15 properties:hasEmailAddress
RDF Containers Describe groups of things A book was created by several authors A lesson is taught by several persons etc. RDF provides a container vocabulary rdf:Bag. Group of resources or literals, including duplicates, where order is not significant rdf:Seq. Group of resources or literals, including duplicates, where order is significant rdf:Alt. Group of resources or literals that are alternatives (typically for a single value of a property) properties:has Address rdf:type people:Raul rdf:Seq rdf:_1 rdf:_2

16 university:hasTeacher
RDF Collections Groups of things represented as a list structure “A container with limits” Constructed using rdf:List, rdf:first, rdf:rest, and rdf:nil rdf:List rdf:type university:hasTeacher rdf:first university:Course1 people:Raul rdf:next rdf:first people:Oscar rdf:next rdf:nil

17 RDF Reification RDF statements about other RDF statements
“Raúl believes that Oscar’s birthdate is on Feb 2nd, 1976 and that his address is Expressed using rdf:Statement, rdf:subject, rdf:predicate, and rdf:object, or using rdf:ID RDF Reification Allows expressing beliefs (and other modalities) Allows expressing trust models, digital signatures, etc. Allows expressing metadata about metadata people:Oscar modal:believes properties:has Address properties:hasBirthDate people:Raul “ ”^^xsd:date Reification using rdf:ID:

18 Main value of a structured value
Sometimes one of the values of a structured value is the main one The weight of an item is 2.4 kilograms The main value is 2.4, which is expressed with rdf:value Scarcely used product:hasWeight product:Item1 rdf:value units:hasWeightUnit “2.4”^^xsd:float units:Kilogram

19 RDF vocabulary summary
Classes Properties Individuals Classification rdf:Property rdf:type Containers rdf:Bag rdf:_1, rdf:_2, rdf:_3… rdf:Seq rdf:Alt Collections rdf:List rdf:first rdf:nil rdf:rest Reification rdf:Statement rdf:subject rdf:predicate rdf:object Values rdf:XMLLiteral rdf:value

20 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

21 RDF Serialisations Normative
RDF/XML (http://www.w3.org/TR/rdf-syntax-grammar/) RDFa (http://www.w3.org/TR/rdfa-core/) Candidate Recommendation (19 February 2013) Turtle (http://www.w3.org/TR/turtle/) Alternative (for human consumption) Notation 3 (N3) (http://www.w3.org/DesignIssues/Notation3.html) N-Triples (http://www.w3.org/TR/rdf-testcases/#ntriples) TriX (http://www.w3.org/2004/03/trix/) Important: the RDF serializations allow different syntactic variants. E.g., the order of RDF statements has no meaning

22 RDF/XML: XML Declaration and Document
XML declaration (<?xml … ?>) Optional but recommended Document element (<rdf:RDF> … </rdf:RDF>) Optionally includes attributes for namespace definition: xml:base. Base URI other than the base URI of the document or external entity (for relative URIs) xmlns. Default namespace xmlns:xxxx. Namespace prefix <?xml version="1.0” encoding=”UTF-8"?> <rdf:RDF     xml:base="http://www.oeg-upm.net/ontologies/people"     xmlns="http://www.oeg-upm.net/ontologies/people#"     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:people="http://www.ontologies.org/ont/people#"> …    </rdf:RDF>

23 RDF/XML: RDF resources
people:hasColleague people:hasColleague people:Oscar people:Asun people:Raul people:hasName people:hasHomePage … <rdf:Description rdf:about="http://www.ontologies.org/ont/people#hasHomePage"/> <rdf:Description rdf:about="http://www.ontologies.org/ont/people#hasColleague"/> <rdf:Description rdf:about="http://www.ontologies.org/ont/people#hasName"/> <rdf:Description rdf:about="#Raul"/> <rdf:Description rdf:about="#Asun”/> <rdf:Description rdf:about="#Oscar”/> … Using the rdf namespace Relative to the base URI

24 RDF/XML: RDF properties
people:hasColleague people:hasColleague people:Oscar people:Asun people:Raul people:hasName people:hasHomePage “Óscar Corcho García” ... <rdf:Description rdf:about="#Asun"> <person:hasColleague> <rdf:Description rdf:about="#Raul" /> </person:hasColleague> <rdf:Description rdf:about="#Asun”> <person:hasHomePage rdf:resource=”http://www.fi.upm.es”/> </rdf:Description> <rdf:Description rdf:about="#Oscar"> <person:hasColleague rdf:resource="#Asun"/> <person:hasName>Oscar Corcho García</person:hasName> Grouping multiple properties Empty property element

25 RDF/XML: Property and language attributes
people:hasColleague people:hasColleague people:Oscar people:Asun people:Raul people:hasName people:hasHomePage “Óscar Corcho García” Language attribute ... <rdf:Description rdf:about="#Asun"> <person:hasPosition xml:lang=“en”>Professor</person:hasPosition> <rdf:Description person:hasName=“Oscar Corcho García” rdf:about="#Oscar"> <person:hasColleague rdf:resource="#Asun"/> </rdf:Description> Property attribute

26 RDF/XML: Typed and XML literals
Typed literal ... <rdf:Description rdf:about="#Raul"> <person:hasHeight rdf:datatype=“http://www.w3.org/2001/XMLSchema#float”> 185 </person:hasHeight> <person:hasSignature rdf:parseType=”Literal”> <signature> <name>Raul</name> </signature> </person:hasSignature> </rdf:Description> XML Literal

27 RDF/XML: Blank nodes Blank node identified Blank node omitted ...
people:hasColleague people:hasColleague people:hasColleague Blank node identified ... <rdf:Description rdf:nodeID=”abc"> <person:hasColleague> <rdf:Description rdf:nodeID=”def” /> </person:hasColleague> <person:hasColleague rdf:parseType=“Resource” > </rdf:Description> Blank node omitted

28 RDF/XML: URI Abbreviations and Typed Nodes
Abbreviation of URI with !ENTITY <?xml version="1.0” encoding=”UTF-8"?> <!DOCTYPE rdf:RDF [ <!ENTITY people "http://www.ontologies.org/ont/people#"> ]> <rdf:RDF ... <rdf:Description rdf:about=“#Asun”> <rdf:type rdf:resource=“&people;Person” /> </rdf:Description> <person:Person rdf:ID=“Oscar”> </person:Person> Abbreviation of URI with rdf:ID Both rdf:about and rdf:ID require xml:base Equivalent to rdf:about=“#name” name can only appear once in the scope of a xml:base Abbreviation of typed node

29 RDF/XML: Complete example
people:hasColleague people:hasColleague people:Oscar people:Asun people:Raul people:hasName people:hasHomePage “Óscar Corcho García” <?xml version="1.0"?> <rdf:RDF     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:people="http://www.ontologies.org/ontologies/people#"     xmlns="http://www.oeg-upm.net/ontologies/people#"     xml:base="http://www.oeg-upm.net/ontologies/people">       <rdf:Description rdf:about="http://www.ontologies.org/ontologies/people#hasHomePage"/>     <rdf:Description rdf:about="http://www.ontologies.org/ontologies/people#hasColleague"/>     <rdf:Description rdf:about="http://www.ontologies.org/ontologies/people#hasName"/>       <rdf:Description rdf:about="#Raul"/>     <rdf:Description rdf:about="#Asun">         <people:hasColleague rdf:resource="#Raul"/>         <people:hasHomePage rdf:resource=”http://www.fi.upm.es”/>     </rdf:Description>     <rdf:Description rdf:about="#Oscar">         <people:hasColleague rdf:resource="#Asun"/>         <people:hasName>Oscar Corcho García</people:hasName>     </rdf:Description>  </rdf:RDF>

30 RDF serializations. Turtle
Terse RDF Triple Language W3C Working Draft 09 August 2011 Extends N-Triples Adding parts of Notation 3 Subset of the SPARQL grammar A Turtle triple: subject predicate object . A Turtle comment: # This is a comment

31 Turtle: IRIs Enclosed in '<' and '>' Absolute
<http://example.org/path/> <http://example.org/path#fragment> Relative to the current base IRI </path> <#fragment> <> Abbreviated @prefix foo: <http://example.org/ns#> . @prefix : <http://other.example.org/ns#> . foo:bar foo: : . :bar : foo:bar . Definition of base IRI @base <http://example.org/ns/> . <a2> <http://example.org/ns/b2> <c2> .

32 Turtle: Literals Without linebreaks With linebreaks
"simple literal" With linebreaks """this is a long literal""" Can have either language suffix or datatype but not both With language suffix "La With datatype IRI "mylexicaldata"^^<http://example.org/my/datatype> "10"^^xsd:decimal Literals without language tag or datatype are literals with the type xsd:string "10"  "10"^^xsd:string

33 Turtle: Blank nodes Using _:label :a :b _:n1 . Using []
:a :b [ :c :d ] . which is the same as: :a :b _:x . _:x :c :d .

34 Turtle: Abbreviations
a is equivalent to rdf:type @prefix doc: <http://example.org/#ns> . <http://example.org/path> a doc:Document . Decimal integers -5  "-5"^^xsd:integer Decimal floating point double/fixed precision numbers 1.3e2  "1.3e2"^^xsd:double Decimal floating point arbitrary precision numbers 0.0  "0.0"^^xsd:decimal Boolean true  "true"^^xsd:boolean

35 Turtle: Abbreviating groups of triples
Triples that only differ in the object :subject :predicate :object1 , :object2 . which is the same as :subject :predicate :object1 . :subject :predicate :object2 . Triples that vary only in predicate and object :subject :predicate1 :obj1 ; :predicate2 :obj2 . :subject :predicate1 :obj1 . :subject :predicate2 :obj2 .

36 Turtle: Abbreviating RDF Collections
Sequence of terms enclosed in ( ) and separated with whitespace Provides a blank node at the start of RDF Collection which may be used in further abbreviations. @prefix : <http://example.org/foo> . :subject :predicate ( :a :b :c ) . :subject :predicate2 () .

37 Turtle: Complete example
people:hasColleague people:hasColleague people:Oscar people:Asun people:Raul people:hasName people:hasHomePage “Óscar Corcho García” @base <http://www.oeg-upm.net/ontologies/people#> people: <http://www.ontologies.org/ontologies/people#> . :Asun people:hasColleague :Raul ; people:hasHomePage <http://www.fi.upm.es/> . :Oscar people:hasColleague :Asun ; people:hasName "Óscar Corcho García" .

38 RDF Serialisations. RDFa
people:hasColleague people:hasColleague people:Oscar people:Asun people:Raul people:hasName people:hasHomePage “Óscar Corcho García” <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body vocab="http://www.oeg-upm.net/ontologies/people#"> <div resource="Asun"> <h2 property="hasName">Asunción Gómez Pérez</h2> <a rel="hasHomePage" href="http://www.oeg-upm.net/">Has home page.</a> <div property="hasColleague" resource="Raul”>Is friend of Raúl.</div> </div> <div resource="Oscar"> <h2 property="hasName">Óscar Corcho García</h2> <div property="hasColleague" resource="Asun">Is friend of Asun.</div> </body> </html>

39 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

40 rdfs:ContainerMembershipProperty
RDF Schema Extends RDF Allows describing classes of resources and their properties Adds constraints on models rdfs:member rdfs:seeAlso rdfs:isDefinedBy rdf:value rdfs:label rdfs:comment rdfs:Resource rdf:first rdf:subject rdf:predicate rdf:object rdf:type rdf:rest rdfs:subPropertyOf rdfs:subclassOf rdf:List rdfs:Container rdf:Statement rdf:Property rdfs:Class rdfs:Literal rdfs:domain rdfs:range rdf:Bag rdf:Seq rdf:Alt rdfs:ContainerMembershipProperty rdfs:Datatype rdf:XMLLiteral rdf:nil rdfs:member rdf:_1 rdf:_2 rdf:_3

41 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

42 Describing classes RDF(S) Person Data rdfs:Class person:Person
rdf:type Person person:Person rdfs:subClassOf person:Professor rdfs:subClassOf person:FullProfessor person:AssociateProfessor rdfs:subClassOf person:InterimAssociateProfessor person:hasColleague person:hasColleague Data data:Oscar data:Asun data:Raul person:hasName person:hasHomePage “Óscar Corcho García”

43 Describing individuals
RDF(S) rdfs:Class rdf:type Person person:Person rdfs:subClassOf person:Professor rdfs:subClassOf person:FullProfessor person:AssociateProfessor rdfs:subClassOf person:InterimAssociateProfessor rdf:type rdf:type rdf:type person:hasColleague person:hasColleague Data data:Oscar data:Asun data:Raul person:hasName person:hasHomePage “Óscar Corcho García”

44 Describing properties
RDF(S) rdf:Property rdfs:Class rdf:type rdf:type Person rdfs:range rdfs:domain rdfs:Literal person:hasName person:Person rdfs:domain rdfs:range rdfs:subClassOf person:hasColleague person:Professor rdfs:subClassOf rdfs:domain person:hasHomePage person:FullProfessor person:AssociateProfessor rdfs:subClassOf person:InterimAssociateProfessor rdf:type rdf:type rdf:type person:hasColleague person:hasColleague Data data:Oscar data:Asun data:Raul person:hasName person:hasHomePage “Óscar Corcho García”

45 “Resource for Raúl García Castro”
Annotating resources rdfs:label “Raúl García” rdfs:label “Raúl” rdfs:comment data:Raul “Resource for Raúl García Castro” rdfs:seeAlso rdfs:isDefinedBy

46 RDF-S vocabulary summary
Classes Properties Individuals Classification rdfs:Resource rdfs:subClassOf rdfs:Class rdfs:domain rdfs:range rdfs:subPropertyOf Datatypes rdfs:Literal rdfs:Datatype Containers rdfs:Container rdfs:member rdfs:ContainerMembershipProperty Annotation rdfs:label rdfs:comment rdfs:seeAlso rdfs:isDefinedBy

47 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

48 RDF/XML syntax (1/2) <?xml version="1.0"?> <!DOCTYPE rdf:RDF [ <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > <!ENTITY person "http://www.oeg-upm.net/ontologies/person#" > ]> <rdf:RDF xmlns="http://www.oeg-upm.net/ontologies/person#" xml:base="http://www.oeg-upm.net/ontologies/person" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:person="http://www.oeg-upm.net/ontologies/person#"> <rdfs:Property rdf:about="&person;hasColleague"> <rdfs:range rdf:resource="#Person"/> <rdfs:domain rdf:resource="#Person"/> </rdfs:Property> <rdfs:Property rdf:about="&person;hasHomePage"> <rdfs:domain rdf:resource="#FullProfessor"/> </rdfs:Property> <rdfs:Property rdf:about="&person;hasName"> <rdfs:domain rdf:resource="#Person"/> <rdfs:range rdf:resource="&rdfs;Literal"/> </rdfs:Property> ...

49 RDF/XML syntax (2/2) ... <rdfs:Class rdf:about="#AssociateProfessor"> <rdfs:subClassOf rdf:resource="#Professor"/> </rdfs:Class> <rdfs:Class rdf:about="#FullProfessor"> <rdfs:subClassOf rdf:resource="#Professor"/> </rdfs:Class> <rdfs:Class rdf:about="#InterimAssociateProfessor"> <rdfs:subClassOf rdf:resource="#AssociateProfessor"/> </rdfs:Class> <rdfs:Class rdf:about="#Person"/> <rdfs:Class rdf:about="#Professor"> <rdfs:subClassOf rdf:resource="#Person"/> </rdfs:Class> <FullProfessor rdf:about="#Asun"> <person:hasHomePage>http://www.fi.upm.es</person:hasHomePage> <person:hasColleague rdf:resource="#Raul"/> </FullProfessor> <AssociateProfessor rdf:about="#Oscar"> <person:hasName>Oscar Corcho García</person:hasName> <person:hasColleague rdf:resource="#Asun"/> </AssociateProfessor> <InterimAssociateProfessor rdf:about="#Raul"/> </rdf:RDF>

50 a is equivalent to rdf:type
Turtle syntax (1/2) @base <http://www.oeg-upm.net/ontologies/person> : <http://www.oeg-upm.net/ontologies/person#> person: <http://www.oeg-upm.net/ontologies/person#> . :hasColleague a rdfs:Property . rdfs:domain :Person . rdfs:range :Person ; :hasHomePage a rdfs:Property . rdfs:domain :FullProfessor . :hasName a rdfs:Property . rdfs:domain :Person ; rdfs:range rdfs:Literal . … a is equivalent to rdf:type

51 a is equivalent to rdf:type
Turtle syntax (2/2) … :Person a rdfs:Class . :Professor a rdfs:Class ; rdfs:subClassOf :Person . :FullProfessor a rdfs:Class ; rdfs:subClassOf :Professor . :AssociateProfessor a rdfs:Class ; :InterimAssociateProfessor a rdfs:Class ; rdfs:subClassOf :AssociateProfessor . :Asun a :FullProfessor ; :hasHomePage "http://www.fi.upm.es" ; :hasColleague :Raul . :Oscar a :AssociateProfessor ; :hasName "Oscar Corcho García" ; :hasColleague :Asun . :Raul a :InterimAssociateProfessor . a is equivalent to rdf:type

52 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

53 RDF(S) limitations RDFS too weak to describe resources in sufficient detail No localised range and domain constraints Can’t say that the range of hasChild is person when applied to persons and elephant when applied to elephants No existence/cardinality constraints Can’t say that all instances of person have a mother that is also a person, or that persons have exactly 2 parents No boolean operators Can’t say or, not, etc. No transitive, inverse or symmetrical properties Can’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetrical Difficult to provide reasoning support No “native” reasoners for non-standard semantics May be possible to reason via FOL axiomatisation 53

54 Index Overview RDF RDF Schema Reasoning RDF(S) management APIs
Introduction RDF components Serializing RDF RDF Schema Main RDF-S components Serializing RDF-S RDF(S) Limitations Reasoning Reasoning with RDF Reasoning with RDF-S RDF(S) management APIs

55 Sample RDF APIs Usually related to a RDF repository
RDF libraries for different languages: Java, Python, C, C++, C#, .Net, Javascript, Tcl/Tk, PHP, Lisp, Obj-C, Prolog, Perl, Ruby, Haskell List in Multilanguage: Redland RDF Application Framework (C, Perl, PHP, Python and Ruby): Java: Jena: Sesame: PHP: RAP - RDF API for PHP: Python: RDFLib: Pyrple:

56 Jena Java framework for building Semantic Web applications
Open source Apache project Created by HP Labs The Jena framework includes: A RDF API An OWL API Reading and writing RDF in RDF/XML, N3 and N-Triples In-memory and persistent storage A rule based inference engine SPARQL query engine

57 Sesame A framework for storage, querying and inferencing of RDF and RDF Schema Java Library for handling RDF Database Server for (remote) access to repositories of RDF data Highly expressive query and transformation languages SeRQL, SPARQL Various back-ends Native Store RDBMS (MySQL, Oracle 10, DB2, PostgreSQL) Main memory Reasoning support RDF Schema reasoner OWL DLP (OWLIM) Domain reasoning (custom rule engine)

58 Jena example. Graph creation
vcard:FN vcard:N John Smith vcard:Given vcard:Family John Smith // some definitions String personURI = "http://somewhere/JohnSmith"; String givenName = "John"; String familyName = "Smith"; String fullName = givenName + " " + familyName; // create an empty Model Model model = ModelFactory.createDefaultModel(); // create the resource // and add the properties cascading style Resource johnSmith = model.createResource(personURI) .addProperty(VCARD.FN, fullName) .addProperty(VCARD.N, model.createResource() .addProperty(VCARD.Given, givenName) .addProperty(VCARD.Family, familyName));

59 Jena example. Read and write
// create an empty model Model model = ModelFactory.createDefaultModel(); // use the FileManager to find the input file InputStream in = FileManager.get().open( inputFileName ); if (in == null) { throw new IllegalArgumentException("File not found"); } // read the RDF/XML file model.read(in, ""); // write it to standard out model.write(System.out); <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:vcard='http://www.w3.org/2001/vcard-rdf/3.0#' > <rdf:Description rdf:nodeID="A0"> <vcard:Family>Smith</vcard:Family> <vcard:Given>John</vcard:Given> </rdf:Description> <rdf:Description rdf:about='http://somewhere/JohnSmith/'> <vcard:FN>John Smith</vcard:FN> <vcard:N rdf:nodeID="A0"/> ... </rdf:RDF>

60 Some RDF editors Command line Online Ontology engineering environments
Standalone Ganesha (http://event-horizon.kicks-ass.net/uni/ganesha/) IsaViz (http://www.w3.org/2001/11/IsaViz/) Morla (http://www.morlardf.net/) RDFAuthor (http://rdfweb.org/people/damian/RDFAuthor/) rdfEditor (http://www.dotnetrdf.org/content.asp?pageID=rdfEditor) RDF Editor in Java (http://sourceforge.net/projects/rdfeditor/) RdfGravity (http://semweb.salzburgresearch.at/apps/rdf-gravity/index.html) Rej (http://infinitesque.net/projects/Legere/components/Rej/) Rhodonite (http://rhodonite.angelite.nl/) Command line RDFe (http://infomesh.net/pyrple/rdfe/) Online RDF Editor (http://tesis-e.googlecode.com/svn/trunk/rdf-editor/index.html) Turtled (http://turtled.net/) Ontology engineering environments Protégé (http://protege.stanford.edu/) Altova SemanticWorks (http://www.altova.com/semanticworks/rdf-editor.html) TopBraid Composer (http://www.topquadrant.com/products/TB_Composer.html)

61 Main References Brickley D, Guha RV (2004) RDF Vocabulary Description Language 1.0: RDF Schema. W3C Recommendation 10 February 2004 Beckett D (2004) RDF/XML Syntax Specification (Revised) W3C Recommendation 10 February 2004 Beckett D, Berners-Lee T, Prud'hommeaux E, Carothers G (Turtle: Terse RDF Triple Language. W3C Candidate Recommendation 19 February 2013) Hayes P (2004) RDF Semantics W3C Recommendation 10 February 2004 RDF validators: RDF resources:

62 Thank you for your attention!


Download ppt "RDF and RDF Schema Raúl García-Castro, Óscar Corcho, Daniel Vila-Suero"

Similar presentations


Ads by Google