KEMBAR78
Linked Data Tutorial (Florianópolis) | PPTX
Mini-curso sobre LinkedDataOscar Corcho, Asunción Gómez Pérez ({ocorcho, asun}@fi.upm.es)Universidad Politécnica de MadridFlorianópolis, September 1st 2010(3º OntoBras 2010)Credits: Raúl García Castro, Oscar Muñoz, Jose Angel Ramos Gargantilla, María del Carmen Suárez de Figueroa, Boris Villazón, Alex de León, Víctor Saquicela, Luis Vilches, Miguel Angel García, Manuel Salvadores,  Juan Sequeda, Carlos Ruiz Moreno and manyothersWorkdistributedunderthelicenseCreativeCommonsAttribution-Noncommercial-Share Alike 3.0
ContentsIntroductiontoLinked DataLinked Data Foundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption2
Whatisthe Web of Linked Data?An extension of the current Web…… where information and services are given well-defined and explicitly represented meaning, …… so that it can be shared and used by humans and machines, ...... better enabling them to work in cooperationHow?Promoting information exchange by tagging web content with machineprocessable descriptions of its meaning. And technologies and infrastructure to do thisAnd clear principles on how to publish datadata
What is Linked Data?Linked Data is a term used to describe a recommended best practice for exposing, sharing, and connecting pieces of data, information, and knowledge on the Semantic Web using URIs and RDF.Part of the Semantic WebExposing, sharing and connecting dataTechnologies: URIs and RDF (although others are also important)
The fourprinciples (Tim Berners Lee, 2006)Use URIs as names for things Use HTTP URIs so that people can look up those names. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) Include links to other URIs, so that they can discover more things. http://www.w3.org/DesignIssues/LinkedData.html5http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html
Linked Open Data evolution2007
2008
20097LOD Cloud May 2007Facts:Focal points:
DBPedia: RDFizedvesion of Wikipiedia; many ingoing and outgoing links
Music-related datasets
Big datasets include FOAF, US Census data
Size approx. 1 billion triples, 250k linksFigure from [4]
8LOD Cloud September 2008Facts:More than 35 datasets interlinked
Commercial players joined the cloud, e.g., BBC
Companies began to publish and host dataset, e.g. OpenLink, Talis, or Garlik.
Size approx. 2 billion triples, 3 million linksFigure from [4]
9LOD Cloud March 2009Facts:Big part from Linking Open Drug cloud and the BIO2RDF project (bottom)
Notable new datasets: Freebase, OpenCalais, ACM/IEEE
Size > 10 billion triplesFigure from [4]
LOD clouds
WhyLinked Data?Basically, tomovefrom a Web of documentsto a Web of DataLet’s try anexample:Tell me whichfootballplayers, born in theprovince of Albacete, in Spain, havescored a goal in theWorld Cup finalDisclaimer:Sorryto use anexampleaboutfootball, butyouhavetounderstandthatforseveralyearsSpaniardswillbetalkingaboutfootball a lot ;-)
Informationsearch in the Web of documents¿?What we were actually looking for
Itwouldbebettertomake a data query…(footballplayersfrom Albacete whoplayedEurocup 2008)
Howshouldwepublish data?Formats in which data ispublishednowadays…XMLHTMLDBsAPIsCSVXLS…However, mainlimitationsfrom a Web of Data point of viewDifficulttointegrateData isnotlinkedtoeachother, as ithappenswith Web documents.
Which format do we use then?RDF (ResourceDescription Framework)Data modelBasedon triples: subject, predicate, object<Oscar> <vive en> <Madrid><Madrid> <es la capital de> <España><España> <es campeona de> <Mundial de Fútbol>…Serialised in differentformatsRDF/XML, RDFa, N3, Turtle, JSON…
URIs (Universal-UniformResourceIdentifer)Two types of identifiers can be used to identify Linked Data resourcesURIRefs(Unique Resource IdentifiersReferences)A URI and an optional FragmentIdentifier separated from the URI by the hash symbol ‘#’http://www.ontology.org/people#Personpeople:PersonPlain URIs can also be used, as in FOAF:http://xmlns.com/foaf/0.1/Person17
How do wepublishLinked Data?ExposingRelationalDatabasesorother similar formatsintoLinked DataD2RTriplifyR2ONOR2OVirtuosoUltrawrap…Usingnative RDF triplestoresSesameJenaOwlimTalisplatform…Incorporatingit in theform of RDFa in CMSslikeDrupal18
How do we consume Linked Data?Linked Data browsersTo explore things and datasets and to navigate between them.Tabulator Browser (MIT, USA), Marbles (FU Berlin, DE), OpenLink RDF Browser (OpenLink, UK), Zitgist RDF Browser (Zitgist, USA), Disco Hyperdata Browser (FU Berlin, DE), Fenfire (DERI, Ireland)Linked Data mashupsSites that mash up (thus combine Linked data)Revyu.com (KMI, UK), DBtune Slashfacet (Queen Mary, UK), DBPedia Mobile (FU Berlin, DE), Semantic Web Pipes (DERI, Ireland) Search enginesTo search for Linked Data.Falcons (IWS, China), Sindice (DERI, Ireland), MicroSearch (Yahoo, Spain), Watson (Open University, UK), SWSE (DERI, Ireland), Swoogle (UMBC, USA)Listing on this slide by T. Heath, M. Hausenblas, C. Bizer, R. Cyganiak, O. Hartig19
Linked Data browsers (Disco)
Linked Data Mashup (LinkedGeoData)© Migración de datos a la Web de los Datos - Enfoques, técnicas y herramientasLuis Manuel Vilches Blázquez
Linked Data Mashup (DBpedia Mobile)http://wiki.dbpedia.org/DBpediaMobile© Migración de datos a la Web de los Datos - Enfoques, técnicas y herramientasLuis Manuel Vilches Blázquez
 Linked Data Search Engines (Sindice and SIG.MA)Entity lookup service. Find a document that mentions a URI or a keyword.
Linked Data SearchEngines (NYT)The New York Times: Alumni In The Newshttp://data.nytimes.com/schools/schools.html
Linked Data SearchEngines (NYT)The New York Times: Source code is available… and is based on SPARQL queries
Oneadditionalmotivation: Open GovernmentGovernment and state administration should be opened at all levels to effective public scrutiny and oversightObjectives:TransparencyParticipationCollaborationInclusionCost reductionInteroperabilityReusabilityLeadershipMarket & Value26Some Links:
 B. Obama –Transparency and Open Government
 T. Berners-Lee - Raw data now!
 J. Manuel Alonso - ¿Qué es Open Data?
Open Government Data
8 Principles of Open Government DataOpen Government. USA and UK27BOTTOM-UPTop-down
Linked Data Mashup (data.gov)Clean Air Status and Trends (CASTNET)http://data-gov.tw.rpi.edu/demo/exhibit/demo-8-castnet.php
Linked Data in the UKEducationhttp://education.data.gov.uk/id/school/106661Parliamenthttp://parliament.psi.enakting.org/id/member/1227MapsE.g., London: http://data.ordnancesurvey.co.uk/id/7000000000041428http://map.psi.enakting.orgTransporthttp://www.dft.gov.uk/naptan/SameAs servicehttp://www.sameas.orgChallengeshttp://gov.tso.co.uk/openup/sparql/gov-transport29
Linked Data Mashup (data.gov.uk)Research Funding Explorerhttp://bis.clients.talis.com/
Open GovernmentSpain. Euskadi31
Open GovernmentSpain. Abredatos32
Open GovernmentSpain. Zaragoza 33
Open GovernmentSpain. Asturias34
Linked Data Mashup (Waterquality)Water quality in Asturias’ beacheshttp://datos.fundacionctic.org/sandbox/asturias/playas/
ContentsIntroductiontoLinked DataLinked Data Foundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption36
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL37
RDF: Resource Description FrameworkW3C recommendationRDF is graphical formalism ( + XML syntax + semantics)For representing metadataFor describing the semantics of information in a machine- accessible wayResources are described in terms of properties andproperty values using RDF statementsStatements are represented as triples, consisting of asubject, predicate and object. [S, P, O]“Oscar Corcho García”person:hasNameperson:hasColleagueoeg:Oscaroeg:Asunperson:hasHomePageperson:hasColleague“http://www.fi.upm.es/”oeg:Raul38
RDF and URIsRDF uses URIRefs(Unique Resource IdentifiersReferences) toidentify resourcesA URIRef consists of a URI and an optional FragmentIdentifier separated from the URI by the hash symbol ‘#’Exampleshttp://www.co-ode.org/people#hasColleaguecoode:hasColleagueA set of URIRefs is known as a vocabularyE.g., the RDF Vocabulary The set of URIRefs used indescribing the RDF concepts:rdf:Property,rdf:Resource, rdf:type, etc.The RDFS Vocabulary The set of URIRefs used indescribing the RDF Schema language: rdfs:Class, rdfs:domain, etc.The ‘Pizza Ontology’ Vocabulary pz:hasTopping,pz:Pizza, pz:VegetarianPizza, etc.39
RDF SerialisationsNormativeRDF/XML (www.w3.org/TR/rdf-syntax-grammar/)Alternative (for human consumption)N3 (http://www.w3.org/DesignIssues/Notation3.html)Turtle (http://www.dajobe.org/2004/01/turtle/)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 meaning40
RDF Serialisations. RDF/XML<?xml version="1.0"?><rdf:RDF    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"    xmlns:person="http://www.ontologies.org/ontologies/people#"    xmlns="http://www.oeg-upm.net/ontologies/people#"    xml:base="http://www.oeg-upm.net/ontologies/people">    <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasHomePage"/>    <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasColleague"/>    <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasName"/>    <rdf:Description rdf:about="#Raul"/>    <rdf:Description rdf:about="#Asun">        <person:hasColleague rdf:resource="#Raul"/>        <person:hasHomePage>http://www.fi.upm.es</person:hasHomePage>    </rdf:Description>    <rdf:Description rdf:about="#Oscar">        <person:hasColleague rdf:resource="#Asun"/>        <person:hasName>Oscar Corcho García</person:hasName>    </rdf:Description></rdf:RDF>41
RDF Serialisations. N3@base  <http://www.oeg-upm.net/ontologies/people >@prefix person: <http://www.ontologies.org/ontologies/people#>:Asun  	person:hasColleague :Raul ;		person:hasHomePage “http://www.fi.upm.es/”.:Oscar 	person:hasColleague :Asun ; 		person:hasName “Óscar Corcho García”.42
ExerciseObjective
Getusedtothedifferentsyntaxesof RDF
Tasks
Takethetextofan RDF file andcreateitscorrespondinggraph
Takean RDF graphandcreateitscorresponding RDF/XML and N3 files 43
Exercise 1.a. Create a graph from a fileOpen the file StickyNote_PureRDF.rdfCreate the corresponding graph from itCompare your graph with those of your colleagues44
Exercise 1.a. StickyNote_PureRDF.rdf45
Exercise 1.b. Create files from a graphTransform the following graph into N3 syntax46hasMeasurementMeasurement8401Sensor029includeshasTemperatureatTimeClass01includes2010-06-12T12:00:1229Computer101hasOwnerUser10AhasNamePedro
Blank nodes: structured property valuesMost real-world data involves structures that are more complicated than sets of RDF triple statementsIn RDF/XML, it is an <rdf:Description> node with no rdf:aboutIn N3, it is a resource identifier that starts with ‘_’ E.g., “_:nodeX”Thisintermediate URI doesnotneedtohave a name“Oscar Corcho García”person:hasNameperson:hasPostalAddressoeg:Oscaraddress:hasStreetNameaddress:cityCampus de Montegancedo s/ncity:BoadillaDelMonte47
Typed literalsSo far, all values have been presented as stringsXML Schema datatypes can be used to specify values (objects in some RDF triple statements)In RDF/XML, this is expressed as:<rdf:Description rdf:about=”#Oscar”>   <person:hasBirthDate 	     rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1976-02-02   </person:hasBirthDate></rdf:Description>In N3, this is expressed as:oeg:Oscar person:hasBirthDate ”1976-02-02”^^xsd:date .person:hasBirthDateoeg:Oscar1976-02-0248
RDF ContainersThere is often the need to describe groups of thingsA book was created by several authorsA lesson is taught by several personsetc.RDF provides a container vocabularyrdf:Bag  A group of resources or literals, possibly including duplicate members, where the order of members is not significantrdf:Seq  A group of resources or literals, possibly including duplicate members, where the order of members is significantrdf:Alt  A group of resources or literals that are alternatives (typically for a single value of a property)rdf:typeperson:hasEmailAddressoeg:Oscarrdf:Seqrdf:_2rdf:_1“oscar.corcho@upm.es”“ocorcho@fi.upm.es”49
RDF ReificationRDF statements about other RDF statements“Raúl believes that Oscar’s birthdate is on Feb 2nd, 1976 and that his e-mail address is ocorcho@fi.upm.es”RDF ReificationAllows expressing beliefs (and other modalities)Allows expressing trust models, digital signatures, etc.Allows expressing metadata about metadatamodal:believesoeg:Raúloeg:Oscarperson:hasBirthDateperson:hasEmailAddress02/02/1976“ocorcho@fi.upm.es”50
Main value of a structured valueSometimes one of the values of a structured value is the main oneThe weight of an item is 2.4 kilograms The most important value is 2.4, which is expressed with rdf:valueScarcely usedproduct:hasWeightproduct:Item1rdf:valueunits:hasWeightUnitunits:kilogram2.451
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL52
RDF inference. Graph matching techniques RDF inference is based on graph matching techniquesBasically, the RDF inference process consists of the following steps:Transform an RDF query into a template graph that has to be matched against the RDF graphIt contains constant and variable nodes, and constant and variable edges between nodesMatch against the RDF graph, taking into account constant nodes and edgesProvide a solution for variable nodes and edges53
RDF inference. Examples (I)Sample RDF graphQuery: “Tell me who are the persons who have Asun as a colleague”Result: oeg:Oscar and oeg:Raúl“Oscar Corcho García”person:hasNameperson:hasColleagueoeg:Oscaroeg:Asunperson:hasHomePageperson:hasColleague“http://www.fi.upm.es/”oeg:Raúlperson:hasColleague?oeg:Asun54
RDF inference. Examples (II)Query: “Tell me which are the relationships between Oscar and Asun”Result: oeg:hasColleagueQuery: “Tell me the homepage of Oscar colleagues”Result: “http://www.fi.upm.es/”?oeg:Oscaroeg:Asunperson:hasColleagueoeg:Oscarperson:hasHomePage?55
RDF inference. Entailment rules56
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL57
RDFS: RDF SchemaW3C RecommendationRDF Schema extends RDF to enable talking about classes of resources, and the properties to be used with themClass definition: rdfs:Class, rdfs:subClassOfProperty definition: rdfs:subPropertyOf, rdfs:range, rdfs:domainOther primitives: rdfs:comment, rdfs:label, rdfs:seeAlso, rdfs:isDefinedByRDFS vocabulary adds constraints on models, e.g.:x,y,ztype(x,y) and subClassOf(y,z) type(x,z)ex:Animalrdfs:subClassOfrdf:typeex:Oscarex:Person58
RDF(S) Serialisations. RDF/XML syntax<?xml version="1.0"?><rdf:RDF    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"    xmlns:person="http://www.ontologies.org/ontologies/people#"    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"    xmlns="http://www.oeg-upm.net/ontologies/people#"    xml:base="http://www.oeg-upm.net/ontologies/people">   <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#Professor">      <rdfs:subClassOf>         <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#Person"/>      </rdfs:subClassOf>    </rdfs:Class>    <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#Lecturer">      <rdfs:subClassOf rdf:resource="http://www.ontologies.org/ontologies/people#Person"/>    </rdfs:Class>    <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#PhD">       <rdfs:subClassOf rdf:resource="http://www.ontologies.org/ontologies/people#Person"/>    </rdfs:Class>    …59
RDF(S) Serialisations. RDF/XML syntax…  <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasHomePage"/>  <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasColleague">    <rdfs:domain rdf:resource=" http://www.ontologies.org/ontologies/people#Person"/>    <rdfs:range rdf:resource=" http://www.ontologies.org/ontologies/people#Person"/>  </rdf:Property>  <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasName">    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>  </rdf:Property>  <person:PhD rdf:ID="Raul"/>  <person:Professor rdf:ID=“Asun">      <person:hasColleague rdf:resource="#Raul"/>      <person:hasHomePage>http://www.fi.upm.es</person:hasHomePage>  </person:Professor>  <person:Lecturer rdf:ID="Oscar">      <person:hasColleague rdf:resource="#Asun"/>      <person:hasName>Óscar Corcho García</person:hasName>  </person:Lecturer></rdf:RDF>60
RDF(S) Serialisations. N3@base  <http://www.oeg-upm.net/ontologies/people >@prefix person: <http://www.ontologies.org/ontologies/people#>person:hasColleague 	a rdf:Property;				rdfs:domain person:Person;				rdfs:range person:Person.person:Professor rdfs:subClassOf person:Person.person:Lecturer rdfs:subClassOf person:Person.person:PhD rdfs:subClassOf person:Person.:Asun  	a person:Professor;		person:hasColleague :Raul ;		person:hasHomePage “http://www.fi.upm.es/”.:Oscar 	a person:Lecturer;		person:hasColleague :Asun ; 		person:hasName “Óscar Corcho García”.:Raul 	a person:PhD.a is equivalent to rdf:type61
RDFSrdfs:Literalrdfs:Classrdf:Typerdfs:rangeFlightrdfs:domainarrivalDaterdf:Typerdfs:domainrdfs:domainrdfs:domaindepartureDatecompany-namesingleFarerdfs:rangerdfs:rangerdf:Typerdfs:rangeunits:currencyQuantityrdf:Typetime:Daterdf:Typerdf:TypeRDFrdf:Propertyrdf:Typerdf:Typecompany-namerdf:TypeIB-4321“Iberia”arrivalDatesingleFaredepartureDate10/11/2005500 eurosRDF(S) Example62
ExerciseObjective
GetusedtothedifferentsyntaxesofRDF(S)
Tasks
TakethetextofanRDF(S) file andcreateitscorrespondinggraph
TakeanRDF(S) graphandcreateitscorresponding RDF/XML and N3 files 63
Exercise 2.a. Create a graph from a fileOpen the files StickyNote.rdf and StickyNote.rdfsCreate the corresponding graph from themCompare your graph with those of your colleagues64
Exercise 2.a. StickyNote.rdf65
Exercise 2.a. StickyNote.rdfs66
Exercise 2.b. Create files from a graphTransform the following graph into N3 syntax67RoomPersonMeasurementObjecthasMeasurementSensor029includeshasTemperatureatTimeClass01includes2010-06-12T12:00:1229Computer101hasOwnerUser10AhasNamePedro
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL68
RDF(S) inference. Entailment rules69
RDF(S) inference. Additional inferences 70
RDF(S) limitationsRDFS too weak to describe resources in sufficient detailNo localised range and domain constraintsCan’t say that the range of hasChild is person when applied to persons and elephant when applied to elephantsNo existence/cardinality constraintsCan’t say that all instances of person have a mother that is also a person, or that persons have exactly 2 parentsNo boolean operatorsCan’t say or, not, etc.No transitive, inverse or symmetrical propertiesCan’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetricalDifficult to provide reasoning supportNo “native” reasoners for non-standard semanticsMay be possible to reason via FOL axiomatisation71
ExerciseObjective
Understand the features of RDF(S) for implementing ontologies, including its limitations
Tasks
Given a scenario description, build a simple ontology in RDF Schema72
Exercise 3. Domain descriptionUn lugar puede ser un lugar de interés.Los lugares de interés pueden ser lugares turísticos o establecimientos, pero no las dos cosas a la vez.Los lugares turísticos pueden ser palacios, iglesias, ermitas y catedrales.Los establecimientos pueden ser hoteles, hostales o albergues.Un lugar está situado en una localidad, la cual a su vez puede ser una villa, un pueblo o una ciudad.Un lugar de interés tiene una dirección postal que incluye su calle y su número.Las localidades tienen un número de habitantes.Las localidades se encuentran situadas en provincias.Covarrubias es un pueblo con 634 habitantes de la provincia de Burgos.El restaurante “El Galo” está situado en Covarrubias, en la calle Mayor, número 5.Una de las iglesias de Covarrubias está en la calle de Santo Tomás.73
Exercise 3. Sample resulting ontology74
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL75
Sample RDF APIsRDF libraries for different languages: Java, Python, C, C++, C#, .Net, Javascript, Tcl/Tk, PHP, Lisp, Obj-C, Prolog, Perl, Ruby, HaskellList in http://esw.w3.org/topic/SemanticWebToolsUsually related to a RDF repositoryMultilanguage:Redland RDF Application Framework (C, Perl, PHP, Python and Ruby): 	http://www.redland.opensource.ac.uk/Java:Jena: http://jena.sourceforge.net/Sesame: http://www.openrdf.org/PHP:RAP - RDF API for PHP: http://www4.wiwiss.fu-berlin.de/bizer/rdfapi/Python:RDFLib: http://rdflib.net/Pyrple: http://infomesh.net/pyrple/76
JenaJava framework for building Semantic Web applicationsOpen source software from HP LabsThe Jena framework includes:A RDF APIAn OWL APIReading and writing RDF in RDF/XML, N3 and N-TriplesIn-memory and persistent storageA rule based inference engineSPARQL query engine77
SesameA framework for storage, querying and inferencing of RDF and RDF SchemaA Java Library for handling RDFA Database Server for (remote) access to repositories of RDF dataHighly expressive query and transformation languagesSeRQL, SPARQLVarious backendsNative StoreRDBMS (MySQL, Oracle 10, DB2, PostgreSQL)main memoryReasoning supportRDF Schema reasonerOWL DLP (OWLIM)domain reasoning (custom rule engine)78
Jena example. Graph creationhttp://.../JohnSmithvcard:FNvcard:NJohn Smithvcard:Givenvcard:FamilySmithJohn// 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)); 79
Jena example. Read and write// create an empty modelModel model = ModelFactory.createDefaultModel();// use the FileManager to find the input fileInputStream in = FileManager.get().open( inputFileName );if (in == null) {    throw new IllegalArgumentException("File not found");}// read the RDF/XML filemodel.read(in, "");// write it to standard outmodel.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:Description>...</rdf:RDF>80
Some RDF editorsIsaVizhttp://www.w3.org/2001/11/IsaViz/Morlahttp://www.morlardf.net/RDFAuthorhttp://rdfweb.org/people/damian/RDFAuthor/RdfGravityhttp://semweb.salzburgresearch.at/apps/rdf-gravity/Rhodonitehttp://rhodonite.angelite.nl/81
Main ReferencesBrickley D, Guha RV (2004) RDF Vocabulary Description Language 1.0: RDF Schema. W3C Recommendationhttp://www.w3.org/TR/PR-rdf-schema/Lassila O, Swick R (1999) Resource Description Framework (RDF) Model and Syntax Specification. W3C Recommendation http://www.w3.org/TR/REC-rdf-syntax/RDF validator: http://www.w3.org/RDF/Validator/RDF resources:http://planetrdf.com/guide/82
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL83
RDF(S) query languagesLanguages developed to allow accessing datasets expressed in RDF(S) (and in some cases OWL)Supported by the most important language APIsJena (HP labs)Sesame (Aduna)Boca (IBM)...There are some differences wrt. languages like SQL, such asCombination of different sourcesTrust managementOpen World Assumption84ApplicationApplicationSQL queriesSPARQL, RQL, etc., queriesRelationalDBRDF(S)OWL
Query typesSelection and extraction“Select all the essays, together with their authors and their authors’ names”“Select everything that is related to the book ‘Bellum Civille’” Reduction: we specify what it should not be returned“Select everything except for the ontological information and the book translators”Restructuring: the original structure is changed in the final result“Invert the relationship ‘author’ by ‘is author of’”Aggregation“Return all the essays together with the mean number of authors per essay”Combination and inferences“Combine the information of a book called ‘La guerra civil’ and whose author is Julius Caesar with the book whose identifier is ‘Bellum Civille’”“Select all the essays, together with its authors and author names”, including also the instances of the subclasses of Essay“Obtain the relationship ‘coauthor’ among persons who have written the same book”85
RDF(S) query language familiesSPARQL W3C Recommendation 15 January 2008Description graphsQuery semanticsTriple database Query structureSquishQLFamilySquishQLrdfDB Query LanguageRDQLBRQLTriQLXPath, XSLT, XQueryXQueryfor RDFXsRQLTreeHuggerandRDFTwigRDFT, Nexus Query LanguageRDFPath, RpathandRXPathVersaRQL FamilyRQLSeRQLeRQLControlled natural languageMetalogOtherAlgaeiTQLN3QLPerlRDF Query LanguageRDEVICE DeductiveLanguageRDFQBERDFQLTRIPLEWQLXML repository Query syntax86
SPARQLSPARQL Protocol and RDF Query LanguageSupported by: Jena, Sesame, IBM Boca, etc.FeaturesItsupportsmostoftheaforementionedqueriesItsupportsdatatypereasoning(datatypes can be requestedinsteadof actual values)Thedomainvocabularyandtheknowledgerepresentationvocabularyare treateddifferently by thequeryinterpretersItallowsmakingqueriesoverpropertieswithmultiplevalues, overmultiplepropertiesof a resourceandoverreificationsQueries can containoptionalstatementsSomeimplementationssupportaggregationqueriesLimitationsNeitherset operationsnorexistentialor universal quantifierscan be included in thequeriesItdoesnotsupportrecursivequeries87
SPARQL is also a protocolSPARQL is a Query Language …Find names and websites of contributors to PlanetRDF: PREFIX foaf: <http://xmlns.com/foaf/0.1/> 	SELECT ?name ?website 	FROM <http://planetrdf.com/bloggers.rdf> 	WHERE { 		?person foaf:weblog ?website .		?person foaf:name ?name . 		?website a foaf:Document }... and a Protocolhttp://.../qps?query-lang=http://www.w3.org/TR/rdf-sparql-query/ &graph-id=http://planetrdf.com/bloggers.rdf&query=PREFIXfoaf: <http://xmlns.com/foaf/0.1/...Services running SPARQL queries over a set of graphs A transport protocol for invoking the service Based on ideas from earlier protocol work such as JosekiDescribing the service with Web Service technologies 88
SPARQL EndpointsSPARQL protocol servicesEnables users (human or other) to query a knowledge base using SPARQLResults are typically returned in one or more machine-processable formatsList of SPARQL Endpointshttp://esw.w3.org/topic/SparqlEndpointsProgrammatic access using libraries:ARC, RAP, Jena, Sesame, Javascript SPARQL, PySPARQL, etc.Examples:89
Example: Querying dbpediaPeople who were born in Berlin before 190090
A simple SPARQL queryData:@prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix : <http://example.org/book/> . :book1 dc:title "SPARQL Tutorial" .Query:SELECT ?titleWHERE{  <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title .}Query result:A pattern is matched against the RDF data
Each way a pattern can be matched yields a solution
The sequence of solutions is filtered by: Project, distinct, order, limit/offset
One of the result forms is applied: SELECT, CONSTRUCT, DESCRIBE, ASK91
Graph patternsBasic Graph Patterns, where a set of triple patterns must matchGroup Graph Pattern, where a set of graph patterns must all matchOptional Graph patterns, where additional patterns may extend the solutionAlternative Graph Pattern, where two or more possible patterns are triedPatterns on Named Graphs, where patterns are matched against named graphs92
@prefix foaf:  <http://xmlns.com/foaf/0.1/> ._:a  foaf:name   "Johnny Lee Outlaw" ._:a  foaf:mbox   <mailto:jlow@example.com> ._:bfoaf:name   "Peter Goodguy" ._:bfoaf:mbox   <mailto:peter@example.org> ._:cfoaf:mbox   <mailto:carol@example.org> .PREFIX foaf:   <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE  { ?x foaf:name ?name .    ?x foaf:mbox ?mbox }Multiple matches93
@prefix dt:   <http://example.org/datatype#> .@prefix ns:   <http://example.org/ns#> .@prefix :     <http://example.org/ns#> .@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .:x   ns:p     "cat"@en .:y   ns:p     "42"^^xsd:integer .:z   ns:p     "abc"^^dt:specialDatatype .SELECT ?v WHERE { ?v ?p "cat" }SELECT ?v WHERE { ?v ?p "cat"@en }SELECT ?v WHERE { ?v ?p 42 }SELECT ?v WHERE { ?v ?p "abc"^^<http://example.org/datatype#specialDatatype> }Matching RDF literals94
@prefix foaf:  <http://xmlns.com/foaf/0.1/> ._:a  foaf:name   "Alice" ._:bfoaf:name   "Bob" .PREFIX foaf:   <http://xmlns.com/foaf/0.1/>SELECT ?x ?nameWHERE  { ?x foaf:name ?name }=Blank node labels in query results95
Group graph patternPREFIX foaf:    <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE  { { ?xfoaf:name ?name . }         { ?xfoaf:mbox ?mbox . }       }SELECT ?xWHERE {}PREFIX foaf:    <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE  { { ?x foaf:name ?name . }         { ?x foaf:mbox ?mbox . FILTER regex(?name, "Smith")}       }96
Optional graph patterns@prefix foaf:       <http://xmlns.com/foaf/0.1/> .@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ._:a  rdf:typefoaf:Person ._:a  foaf:name       "Alice" ._:a  foaf:mbox       <mailto:alice@example.com> ._:a  foaf:mbox       <mailto:alice@work.example> ._:brdf:typefoaf:Person ._:bfoaf:name       "Bob" .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE  { ?x foaf:name  ?name .OPTIONAL { ?x  foaf:mbox  ?mbox }       }97
Multiple optional graph patterns@prefix foaf:       <http://xmlns.com/foaf/0.1/> ._:a  foaf:name       "Alice" ._:a  foaf:homepage   <http://work.example.org/alice/> ._:bfoaf:name       "Bob" ._:bfoaf:mbox       <mailto:bob@work.example> .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mbox ?hpageWHERE  { ?x foaf:name  ?name .OPTIONAL { ?x foaf:mbox ?mbox } .         OPTIONAL { ?x foaf:homepage ?hpage }       }98
Alternative graph patterns@prefix dc10:  <http://purl.org/dc/elements/1.0/> .@prefix dc11:  <http://purl.org/dc/elements/1.1/> ._:a  dc10:title     "SPARQL Query Language Tutorial" ._:a  dc10:creator   "Alice" ._:b  dc11:title     "SPARQL Protocol Tutorial" ._:b  dc11:creator   "Bob" ._:c  dc10:title     "SPARQL" ._:c  dc11:title     "SPARQL (updated)" .PREFIX dc10:  <http://purl.org/dc/elements/1.0/>PREFIX dc11:  <http://purl.org/dc/elements/1.1/>SELECT ?titleWHERE  { { ?book dc10:title  ?title } UNION          { ?book dc11:title  ?title } }SELECT ?x ?yWHERE  { { ?book dc10:title ?x } UNION          { ?book dc11:title ?y } }SELECT ?title ?authorWHERE   { { ?book dc10:title ?title . ?book dc10:creator ?author }UNION    { ?book dc11:title ?title . ?book dc11:creator ?author }}99
Patterns on named graphs# Named graph: http://example.org/foaf/aliceFoaf@prefix foaf:<http://.../foaf/0.1/> .@prefix rdf:<http://.../1999/02/22-rdf-syntax-ns#> .@prefix rdfs:<http://.../2000/01/rdf-schema#> ._:a  foaf:name     "Alice" ._:a  foaf:mbox     <mailto:alice@work.example> ._:a  foaf:knows    _:b ._:b  foaf:name     "Bob" ._:b  foaf:mbox     <mailto:bob@work.example> ._:b  foaf:nick     "Bobby" ._:b  rdfs:seeAlso  <http://example.org/foaf/bobFoaf> .<http://example.org/foaf/bobFoaf>     rdf:type      foaf:PersonalProfileDocument .# Named graph: http://example.org/foaf/bobFoaf@prefix foaf:<http://.../foaf/0.1/> .@prefix rdf:<http://.../1999/02/22-rdf-syntax-ns#> .@prefix rdfs:<http://.../2000/01/rdf-schema#> ._:z  foaf:mbox     <mailto:bob@work.example> ._:z  rdfs:seeAlso  <http://example.org/foaf/bobFoaf> ._:z  foaf:nick     "Robert" .<http://example.org/foaf/bobFoaf>     rdf:type      foaf:PersonalProfileDocument .100
Patterns on named graphs IIPREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?src ?bobNickFROM NAMED <http://example.org/foaf/aliceFoaf>FROM NAMED <http://example.org/foaf/bobFoaf>WHERE  {GRAPH ?src    { ?xfoaf:mbox <mailto:bob@work.example> .      ?xfoaf:nick ?bobNick    }  }PREFIX foaf: <http://xmlns.com/foaf/0.1/>PREFIX data: <http://example.org/foaf/>SELECT ?nickFROM NAMED <http://example.org/foaf/aliceFoaf>FROM NAMED <http://example.org/foaf/bobFoaf>WHERE  {GRAPH data:bobFoaf {         ?x foaf:mbox <mailto:bob@work.example> .         ?x foaf:nick ?nick }  }101
Restricting values@prefix dc:   <http://purl.org/dc/elements/1.1/> .@prefix :     <http://example.org/book/> .@prefix ns:   <http://example.org/ns#> .:book1  dc:title  "SPARQL Tutorial" .:book1  ns:price  42 .:book2  dc:title  "The Semantic Web" .:book2  ns:price  23 .PREFIX  dc:  <http://purl.org/dc/elements/1.1/>SELECT  ?titleWHERE   { ?x dc:title ?titleFILTER regex(?title, "^SPARQL")         }PREFIX  dc:  <http://purl.org/dc/elements/1.1/>SELECT  ?titleWHERE   { ?x dc:title ?titleFILTER regex(?title, "web", "i" )         }PREFIX  dc:  <http://purl.org/dc/elements/1.1/>PREFIX  ns:  <http://example.org/ns#>SELECT  ?title ?priceWHERE   { ?x ns:price ?price .FILTER (?price < 30.5)          ?x dc:title ?title . }102
Value testsBased on XQuery 1.0 and XPath 2.0 Function and Operators XSD boolean, string, integer, decimal, float, double, dateTime Notation <, >, =, <=, >= and != for value comparisonApply to any type BOUND, isURI, isBLANK, isLITERAL REGEX, LANG, DATATYPE, STR (lexical form) Function call for casting and extensions functions 103
Solution sequences and modifiersSELECT ?nameWHERE { ?x foaf:name ?name ; :empId ?emp }ORDER BY ?name DESC(?emp)Order modifier: put the solutions in orderProjection modifier: choose certain variablesDistinct modifier: ensure solutions in the sequence are uniqueReduced modifier: permit elimination of some non-unique solutionsLimit modifier: restrict the number of solutionsOffset modifier: control where the solutions start from in the overall sequence of solutionsSELECT ?nameWHERE { ?x foaf:name ?name }SELECT DISTINCT ?name WHERE { ?x foaf:name ?name }SELECT REDUCED ?name WHERE { ?x foaf:name ?name }SELECT ?nameWHERE { ?x foaf:name ?name }LIMIT 20SELECT  ?name WHERE { ?x foaf:name ?name }ORDER BY ?nameLIMIT   5OFFSET  10104
SPARQL query formsSELECTReturns all, or a subset of, the variables bound in a query pattern matchCONSTRUCTReturns an RDF graph constructed by substituting variables in a set of triple templatesASKReturns a boolean indicating whether a query pattern matches or notDESCRIBEReturns an RDF graph that describes the resources found105
SPARQL query forms: SELECT@prefix  foaf:  <http://xmlns.com/foaf/0.1/> ._:a    foaf:name   "Alice" ._:a    foaf:knows  _:b ._:a    foaf:knows  _:c ._:bfoaf:name   "Bob" ._:cfoaf:name   "Clare" ._:cfoaf:nick   "CT" .PREFIX foaf:    <http://xmlns.com/foaf/0.1/>SELECT ?nameX ?nameY ?nickYWHERE  { ?x foaf:knows ?y ;       foaf:name ?nameX .    ?y foaf:name ?nameY .    OPTIONAL { ?y foaf:nick ?nickY }  }106
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> ._:a    foaf:name   "Alice" ._:a    foaf:mbox   <mailto:alice@example.org> .PREFIX foaf:    <http://xmlns.com/foaf/0.1/>PREFIX vcard:   <http://www.w3.org/2001/vcard-rdf/3.0#>CONSTRUCT   { <http://example.org/person#Alice> vcard:FN ?name }WHERE       { ?x foaf:name ?name }Query result:@prefix vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> .<http://example.org/person#Alice> vcard:FN "Alice" .SPARQL query forms: CONSTRUCT107
SPARQL query forms: ASK@prefix foaf:       <http://xmlns.com/foaf/0.1/> ._:a  foaf:name       "Alice" ._:a  foaf:homepage   <http://work.example.org/alice/> ._:b  foaf:name       "Bob" ._:b  foaf:mbox       <mailto:bob@work.example> .PREFIX foaf:    <http://xmlns.com/foaf/0.1/>ASK  { ?xfoaf:name  "Alice" }Query result:yes108
PREFIX ent:  <http://org.example.com/employees#>DESCRIBE ?x WHERE { ?xent:employeeId "1234" }Query result:@prefix foaf:   <http://xmlns.com/foaf/0.1/> .@prefix vcard:  <http://www.w3.org/2001/vcard-rdf/3.0> .@prefix exOrg:  <http://org.example.com/employees#> .@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix owl:    <http://www.w3.org/2002/07/owl#>_:a     exOrg:employeeId    "1234" ;        foaf:mbox_sha1sum   "ABCD1234" ;        vcard:N         [ vcard:Family       "Smith" ;           vcard:Given        "John"  ] .foaf:mbox_sha1sum  rdf:type  owl:InverseFunctionalProperty .SPARQL query forms: DESCRIBE109
Main ReferencesPrud’hommeaux E, Seaborne A (2008) SPARQL Query Language for RDF. W3C Recommendation http://www.w3.org/TR/rdf-sparql-query/SPARQL validator: 	   http://www.sparql.org/validator.htmlSPARQL implementations: 			http://esw.w3.org/topic/SparqlImplementationsSPARQL Endpoints http://esw.w3.org/topic/SparqlEndpointsSPARQL in Dbpediahttp://dbpedia.org/sparql110
IndexResourceDescription Framework (RDF)RDF primitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL111
Description LogicsA family of logic based Knowledge Representation formalismsDescendants of semantic networks and KL-ONEDescribe domain in terms of concepts (classes), roles (relationships) and individualsSpecificlanguagescharacterisedbytheconstructors and axiomsusedtoassertknowledgeaboutclasses, roles and individuals.Example: ALC (theleastexpressivelanguage in DL thatispropositionallyclosed)Constructors: boolean(and, or, not)Role restrictionsDistinguished by:Model theoretic semanticsDecidable fragments of FOLClosely related to Propositional Modal & Dynamic LogicsProvision of inference servicesSound and complete decision procedures for key problemsImplemented systems (highly optimised)
Structure of DL OntologiesA DL ontology can be divided into two parts:Tbox (Terminological KB): a set of axioms that describe the structure of a domain :Doctor  PersonPerson  Man  WomanHappyFather  Man  hasDescendant.(Doctor  hasDescendant.Doctor)Abox (Assertional KB): a set of axioms that describe a specific situation :John  HappyFather hasDescendant (John, Mary)
Mostcommonconstructors in classdefinitionsIntersection: C1 ...  Cn		Human  MaleUnion: C1  ...  Cn		Doctor  LawyerNegation: C			 MaleNominals: {x1}  ...  {xn}		{john}  ...  {mary}Universal restriction: P.C		hasChild.DoctorExistentialrestriction: P.C	hasChild.LawyerMaximumcardinality: nP.C	 3hasChild.DoctorMinimumcardinality: nP.C	1hasChild.MaleSpecificValue: P.{x}		hasColleague.{Matthew}Nesting of constructors can bearbitrarilycomplexPerson hasChild.(Doctor hasChild.Doctor)Lots of redundancyAB is equivalent to ( A  B)P.C is equivalent to P. C
OWL (1.0 and 1.1)February 2004Web Ontology LanguageBuilt on top of RDF(S)Three layers: OWL Lite
 A small subset of primitives
 Easier for frame-based tools to transition to
 OWL DL
 Description logic
 Decidable reasoning
 OWL Full
 RDF extension, allows metaclassesSeveral syntaxes: Abstract syntax
 Manchester syntax
 RDF/XMLOWL 2 (I). New featuresOctober 2009New featuresSyntactic sugarDisjoint union of classesNew expressivityKeysProperty chainsRicher datatypes, data rangesQualified cardinality restrictionsAsymmetric, reflexive, and disjoint propertiesEnhanced annotation capabilities New syntaxOWL2 Manchester syntax
OWL 2 (II). Three new profilesOWL2 ELOntologies that define very large numbers of classes and/or properties, Ontology consistency, class expression subsumption, and instance checking can be decided in polynomial time. OWL2 QLSound and complete query answering is in LOGSPACE (more precisely, in AC0) with respect to the size of the data (assertions),Provides many of the main features necessary to express conceptual models (UML class diagrams and ER diagrams). It contains the intersection of RDFS and OWL 2 DL.OWL2 RLInspired by Description Logic Programs and pD*. Syntactic subset of OWL 2 which is amenable to implementation using rule-based technologies, and presenting a partial axiomatization of the OWL 2 RDF-Based Semantics in the form of first-order implications that can be used as the basis for such an implementation. Scalable reasoning without sacrificing too much expressive power. Designed forOWL applications trading the full expressivity of the language for efficiency, RDF(S) applications that need some added expressivity from OWL 2.
OWL: Most common constructorsIntersection: 	   C1 ...  CnintersectionOf		Human  MaleUnion: 		   C1  ...  CnunionOf			Doctor  LawyerNegation: 		   C		complementOf		MaleNominals: 		   {x1}  ...  {xn}	oneOf			{john}  ...  {mary}Universal restriction: 	   P.C		allValuesFrom		hasChild.DoctorExistentialrestriction: 	   P.C		someValuesFrom		hasChild.LawyerMaximumcardinality: 	   nP[.C]		maxCardinality (qualifiedornot) 	3hasChild[.Doctor]Minimumcardinality: 	   nP[.C]		minCardinality (qualifiedornot) 	1hasChild[.Male]Exactcardinality: 	   =nP[.C]		exactCardinality (qualifiedornot) 	=1hasMother[.Female]SpecificValue: 	   P.{x}		hasValue			hasColleague.{Matthew}Local reflexivity:	   --		hasSelfNarcisist  Person  hasSelf(loves)Keys		   --		hasKeyhasKey(Person, passportNumber, country)Subclass		   C1  C2		subClassOf			Human  Animal  BipedEquivalence	   	   C1  C2		equivalentClass		Man  Human  MaleDisjointness	   	   C1  C2  	disjointWith, AllDisjointClasses	Male  Female  DisjointUnion	   C  C1  ...  Cn and Ci Cj   foralli≠jdisjointUnionOf	Person DisjointUnionOf (Man, Woman)Metaclasses and annotations on axioms are also valid in OWL2, and declarations of classes have to provided.Full list available in reference specs and in the Quick Reference Guide: http://www.w3.org/2007/OWL/refcard
OWL: Most common constructorsSubproperty	   P1  P2		subPropertyOf		hasDaughter  hasChildEquivalence	   P1  P2		equivalentProperty		cost  priceDisjointProperties	   P1  ...  Pn  	disjointObjectProperties	hasDaughter  hasSon  Inverse		   P1  P2-		inverseOf			hasChild  hasParent-Transitive		   P+  P		TransitiveProperty		ancestor+  ancestorFunctional		     1P		FunctionalProperty		T  1hasMotherInverseFunctional	     1P-		InverseFunctionalProperty 	T  1hasPassportID-Reflexive				ReflexivePropertyIrreflexive				IrreflexivePropertyAsymmetric			AsymmetricPropertyProperty chains	   P  P1 o ... o Pn	propertyChainAxiom		hasUncle  hasFather o hasBrotherEquivalence	   {x1}  {x2}	sameIndividualAs		{oeg:OscarCorcho}{img:Oscar}Different		   {x1}  {x2}	differentFrom, AllDifferent	{john}  {peter}NegativePropertyAssertion		NegativeDataPropertyAssertion	 {hasAge john 35}NegativeObjectPropertyAssertion	 {hasChild john peter}Besides, top and bottom object and datatype properties exist
Basic Inference TasksSubsumption – check knowledge is correct (captures intuitions)Does C subsume D w.r.t. ontology O? (in every modelI of O, CIDI )Equivalence – check knowledge is minimally redundant (no unintended synonyms)Is C equivalent to D w.r.t. O? (in every modelI of O, CI = DI )Consistency – check knowledge is meaningful (classes can have instances)Is C satisfiable w.r.t. O? (there exists some modelI of O s.t. CI)Instantiation and queryingIs x an instance of C w.r.t. O? (in every modelI of O, xICI )Is (x,y) an instance of R w.r.t. O? (in every modelI of O, (xI,yI) RI )All reducible to KB satisfiability or concept satisfiability w.r.t. a KBCan be decided using highly optimised tableaux reasoners
MainReferences    W3C OWL Working Group (2009) OWL2 Web Ontology Language Document Overview. http://www.w3.org/TR/2009/REC-owl2-overview-20091027/    Dean M, Schreiber G (2004) OWL Web Ontology Language Reference. W3C Recommendation. http://www.w3.org/TR/owl-ref/Gómez-Pérez, A.; Fernández-López, M.; Corcho, O.  Ontological Engineering. Springer Verlag. 2003	Capítulo 4: Ontology languagesBaader F, McGuinness D, Nardi D, Patel-Schneider P (2003) The Description Logic Handbook: Theory, implementation and applications. Cambridge University Press, Cambridge, United KingdomJena web site:http://jena.sourceforge.net/Jena API:	http://jena.sourceforge.net/tutorial/RDF_API/Jena tutorials:http://www.ibm.com/developerworks/xml/library/j-jena/index.htmlhttp://www.xml.com/pub/a/2001/05/23/jena.htmlPellet:		http://clarkparsia.com/pellet     RACER:		http://www.racer-systems.com/FaCT++:		http://owl.man.ac.uk/factplusplus/HermIT:		http://hermit-reasoner.com/
ContentsIntroductiontoLinked DataLinked Data Foundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption122
MethodologicalguidelinesforLinked Data publicationMotivationRelated WorkGeoLinkedDataIdentification of the data sourcesVocabulary DevelopmentGeneration of the RDF dataPublication of the RDF dataData cleansingLinking the RDF dataEnable effective discoveryFuture Work
GeoLinkedDataIt is an open initiative whose aim is to enrich the Web of Data with Spanish geospatial data.This initiative has started off by publishing diverse information sources, such as National Geographic Institute of Spain (IGN-E) and National Statistics Institute (INE)http://geo.linkeddata.es
Motivation		99.171 % English		0.019 % SpanishThe Web of Data ismainlyforEnglishspeakersPoorpresence of SpanishSource:Billion Triples dataset at http://km.aifb.kit.edu/projects/btc-2010/Thanks to Aidan and Richard
Related Work
Impact of Geo.linkeddata.esNúmero de tripletas en Español (July): 1.412.248 Número de tripletas en Español (End august): 21.463.088127Asunción Gómez Pérez
Processfor Publishing Linked Data onthe WebIdentificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
1. Identification and selection of the data sourcesIdentificationof the data sourcesInstituto GeográficoNacionalVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataInstituto Nacionalde EstadísticaEnable effective discovery
1. Identification and selection of the data sourcesInstituto Geográfico Nacional (GeographicSpanishInstitute)Multilingual (Spanish, Vasc, Gallician, Catalan)ConceptualizationmistmatchesGranularity (scale concept)Textual informationParticularatiesLongitudelatitudeInstituto Nacional de Estadística (StatisticSpanishInstitute)
Monolingual
Numericalinformation
ParticularatiesGeo (textual level)Temporal130Asunción Gómez Pérez
1. Identification and selection of the data sourcesIGN-E
1. Identification and selection of the data sourcesIndustryProductionIndexYearProvince
2. Vocabulary developmenthttp://www4.wiwiss.fu-berlin.de/bizer/pub/LinkedDataTutorial/#whichvocabsIdentificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataThisisnotenoughPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
2. VocabularydevelopmentFeaturesLightweight : Taxonomies and a fewpropertiesConsensuatedvocabulariesToavoidthemappingproblemsMultilingualLinked data are multilingualTheNeOnmethodology can helptoRe-enginer Non ontologicalresourcesintoontologiesPros: use domainterminologyalreadyconsensuatedbydomainexpertsWithdraw in heavyweightontologiesthosefeaturesthatyoudon’tneedReuseexistingvocabularies134Identificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discoveryAsunción Gómez Pérez
Knowledge ResourcesOntological ResourcesO. Design Patterns34O. Repositories and Registries56FlogicRDF(S)OWLOntologicalResourceReuse              O. Aligning              O. Merging562Ontology DesignPattern ReuseNon Ontological ResourceReuse436Non Ontological Resources2Ontological ResourceReengineering7GlossariesDictionariesLexicons5Non Ontological ResourceReengineering46ClassificationSchemasThesauriTaxonomiesAlignments2RDF(S)1FlogicO. ConceptualizationO. ImplementationO. FormalizationO. SpecificationSchedulingOWL8Ontology Restructuring(Pruning, Extension, Specialization, Modularization)9O. Localization1,2,3,4,5,6,7,8, 9Ontology Support Activities: Knowledge Acquisition (Elicitation); Documentation; Configuration Management; Evaluation (V&V); Assessment135
Vocabularydevelopment: SpecificationContent requirements: Identifythe set of questionsthattheontologyshouldanswerWhichone are theprovinces in Spain?Where are thebeaches?Where are thereservoirs?Identifytheproductionindex in MadridWhichoneisthecitywithhigherproductionindex?Give me Madrid latitude and altitude….Non-contentrequirementsTheontologymustbe in thefourofficialSpanishlanguages136Asunción Gómez Pérez
2. Lightweight Ontology DevelopmentWGS84 Geo Positioning: an RDF vocabularyscv:Dimensionscv:Itemscv:Datasethydrographical phenomena (rivers, lakes, etc.)Vocabulary for instants, intervals, durations, etc.Names and international code systems for territories and groupsOntology for OGC Geography Markup Language reusedFollowing the INSPIRE (INfrastructure for SPatial InfoRmation in Europe) recommendation.hydrOntology,SCOVO, FAO Geopolitcal, WGS84, GML, and Time
Objetivos:INSPIRE intenta conseguir fuentes armonizadas de Información Geográfica para dar soporte a la formulación, implementación y evaluación de políticas comunitarias (Medio Ambiente, etc).Fuentes de Información Geográfica: Bases de datos de los Estados Miembros (UE) a nivel local, regional, nacional e internacional.Contexto – Directiva INSPIRE Luis Manuel Vilches Blázquez
INSPIRE - AnexosLuis Manuel Vilches Blázquez
hydrOntologyExistencia de gran diversidad de problemas (múltiples fuentes, heterogeneidad de contenido y estructuración, ambigüedad del lenguaje natural, etc.) en la información geográfica.Necesidad de un modelo compartido para solventar los problemas de armonización y estructuración de la información hidrográfica.hydrOntology es una ontología global de dominio desarrollada conforme a un acercamiento top-down. Recubrir la mayoría de los fenómenos representables cartográficamente asociados al dominio hidrográfico.Servir como marco de armonización entre los diferentes productores de información geo-espacial en el entorno nacional e internacional.Comenzar con los pasos necesarios para obtener una mejor organización y gestión de la información geográfica (hidrográfica).Luis Manuel Vilches Blázquez
FuentesTesauros y BibliografíaCatálogos de fenómenosGettyFTT ADLBCN25GEMETWFDCC.AA.EGM & ERMDiccionarios yMonografíasBCN200Nomenclátor Geográfico NacionalNomenclátor ConcisoLuis Manuel Vilches Blázquez
Criterios de estructuración Directiva Marco del AguaPropuesta por Parlamento y Consejo de la UELista de definiciones de fenómenos hidrográficosProyecto SDIGERProyecto piloto INSPIREDos cuencas, países e idiomasCriterios semánticosDiccionarios geográficosDiccionario de la Real Academia de la LenguaWordNetWikipediaBibliografía de varias áreas de conocimientoHerencia: Estructuración actual de catálogosAsesoramiento expertos en toponimia del IGNLuis Manuel Vilches Blázquez
 Modelización del dominio hidrográfico Luis Manuel Vilches Blázquez
Implementación & Formalizacón+  Pellet41253+150 conceptos (classes) , 47 tipos de relaciones (properties) y 64 tipos de atributos (attribute types)Luis Manuel Vilches Blázquez
2. Vocabularydevelopment: HydrOntology145Asunción Gómez Pérez
3. Generation of RDFFrom the Data sourcesGeographic information (Databases)Statistic information (.xsl)Geospatial information Different technologies for RDF generationReengineering patternsR20 and ODEMapsterAnnotation toolsGeometry generationIdentificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
3. Generation of the RDF DataNOR2OINEODEMapsterIGNGeometry2RDFGeospatialcolumnIGN
3. Generation of the RDF Data / instances NOR2O is a software librarythatimplementsthetransformationsproposedbythePatternsfor Re-engineering Non-OntologicalResources (PR-NOR). Currentlywehave 16 PR-NORs.PR-NORs define a procedurethattransforms a Non-OntologicalResource (NOR) componentsintoontologyelements. http://ontologydesignpatterns.org/· ClassificationschemesNOR2O· Thesauri· LexiconsNOR2OFAO Water classification· Classification scheme· Path enumeration data model· Implemented in a database
Re-engineeringModelforNORsPatterns for Re-engineeringNon-Ontological Resources (PR-NOR)Ontology Forward Engineering    Con-ceptualSpeci-ficationNOR Reverse EngineeringConceptua-lizationTransformationRequirementsFormalizationDesignImplementationImplementationRDF(S)Non-Ontological ResourceOntology
PR-NOR library at the ODP PortalTechnologicalsupporthttp://ontologydesignpatterns.org/wiki/Submissions:ReengineeringODPs
3. Generation of the RDF Data – NOR2ONOR2OYearIndustry Production IndexProvince
hydrOntology & Bases de DatosNGN1:25.000multilingüe© Migración de datos a la Web de los Datos - Enfoques, técnicas y herramientasLuis Manuel Vilches Blázquez
3. Generation of the RDF Data – R2O & ODEMapsterCreation of the R2O Mappings
3. Generation of the RDF Data – Geometry2RDFOracle STO UTIL package SELECT  TO_CHAR(SDO_UTIL.TO_GML311GEOMETRY(geometry)) 	AS Gml311GeometryFROM "BCN200"."BCN200_0301L_RIO" cWHERE   c.Etiqueta='Arroyo'
3. Generation of the RDF Data – Geometry2RDF
3. Generation of the RDF Data – Geometry2RDF

Linked Data Tutorial (Florianópolis)

  • 1.
    Mini-curso sobre LinkedDataOscarCorcho, Asunción Gómez Pérez ({ocorcho, asun}@fi.upm.es)Universidad Politécnica de MadridFlorianópolis, September 1st 2010(3º OntoBras 2010)Credits: Raúl García Castro, Oscar Muñoz, Jose Angel Ramos Gargantilla, María del Carmen Suárez de Figueroa, Boris Villazón, Alex de León, Víctor Saquicela, Luis Vilches, Miguel Angel García, Manuel Salvadores, Juan Sequeda, Carlos Ruiz Moreno and manyothersWorkdistributedunderthelicenseCreativeCommonsAttribution-Noncommercial-Share Alike 3.0
  • 2.
    ContentsIntroductiontoLinked DataLinked DataFoundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption2
  • 3.
    Whatisthe Web ofLinked Data?An extension of the current Web…… where information and services are given well-defined and explicitly represented meaning, …… so that it can be shared and used by humans and machines, ...... better enabling them to work in cooperationHow?Promoting information exchange by tagging web content with machineprocessable descriptions of its meaning. And technologies and infrastructure to do thisAnd clear principles on how to publish datadata
  • 4.
    What is LinkedData?Linked Data is a term used to describe a recommended best practice for exposing, sharing, and connecting pieces of data, information, and knowledge on the Semantic Web using URIs and RDF.Part of the Semantic WebExposing, sharing and connecting dataTechnologies: URIs and RDF (although others are also important)
  • 5.
    The fourprinciples (TimBerners Lee, 2006)Use URIs as names for things Use HTTP URIs so that people can look up those names. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) Include links to other URIs, so that they can discover more things. http://www.w3.org/DesignIssues/LinkedData.html5http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html
  • 6.
    Linked Open Dataevolution2007
  • 7.
  • 8.
    20097LOD Cloud May2007Facts:Focal points:
  • 9.
    DBPedia: RDFizedvesion ofWikipiedia; many ingoing and outgoing links
  • 10.
  • 11.
    Big datasets includeFOAF, US Census data
  • 12.
    Size approx. 1billion triples, 250k linksFigure from [4]
  • 13.
    8LOD Cloud September2008Facts:More than 35 datasets interlinked
  • 14.
    Commercial players joinedthe cloud, e.g., BBC
  • 15.
    Companies began topublish and host dataset, e.g. OpenLink, Talis, or Garlik.
  • 16.
    Size approx. 2billion triples, 3 million linksFigure from [4]
  • 17.
    9LOD Cloud March2009Facts:Big part from Linking Open Drug cloud and the BIO2RDF project (bottom)
  • 18.
    Notable new datasets:Freebase, OpenCalais, ACM/IEEE
  • 19.
    Size > 10billion triplesFigure from [4]
  • 20.
  • 21.
    WhyLinked Data?Basically, tomovefroma Web of documentsto a Web of DataLet’s try anexample:Tell me whichfootballplayers, born in theprovince of Albacete, in Spain, havescored a goal in theWorld Cup finalDisclaimer:Sorryto use anexampleaboutfootball, butyouhavetounderstandthatforseveralyearsSpaniardswillbetalkingaboutfootball a lot ;-)
  • 22.
    Informationsearch in theWeb of documents¿?What we were actually looking for
  • 23.
    Itwouldbebettertomake a dataquery…(footballplayersfrom Albacete whoplayedEurocup 2008)
  • 24.
    Howshouldwepublish data?Formats inwhich data ispublishednowadays…XMLHTMLDBsAPIsCSVXLS…However, mainlimitationsfrom a Web of Data point of viewDifficulttointegrateData isnotlinkedtoeachother, as ithappenswith Web documents.
  • 25.
    Which format dowe use then?RDF (ResourceDescription Framework)Data modelBasedon triples: subject, predicate, object<Oscar> <vive en> <Madrid><Madrid> <es la capital de> <España><España> <es campeona de> <Mundial de Fútbol>…Serialised in differentformatsRDF/XML, RDFa, N3, Turtle, JSON…
  • 26.
    URIs (Universal-UniformResourceIdentifer)Two typesof identifiers can be used to identify Linked Data resourcesURIRefs(Unique Resource IdentifiersReferences)A URI and an optional FragmentIdentifier separated from the URI by the hash symbol ‘#’http://www.ontology.org/people#Personpeople:PersonPlain URIs can also be used, as in FOAF:http://xmlns.com/foaf/0.1/Person17
  • 27.
    How do wepublishLinkedData?ExposingRelationalDatabasesorother similar formatsintoLinked DataD2RTriplifyR2ONOR2OVirtuosoUltrawrap…Usingnative RDF triplestoresSesameJenaOwlimTalisplatform…Incorporatingit in theform of RDFa in CMSslikeDrupal18
  • 28.
    How do weconsume Linked Data?Linked Data browsersTo explore things and datasets and to navigate between them.Tabulator Browser (MIT, USA), Marbles (FU Berlin, DE), OpenLink RDF Browser (OpenLink, UK), Zitgist RDF Browser (Zitgist, USA), Disco Hyperdata Browser (FU Berlin, DE), Fenfire (DERI, Ireland)Linked Data mashupsSites that mash up (thus combine Linked data)Revyu.com (KMI, UK), DBtune Slashfacet (Queen Mary, UK), DBPedia Mobile (FU Berlin, DE), Semantic Web Pipes (DERI, Ireland) Search enginesTo search for Linked Data.Falcons (IWS, China), Sindice (DERI, Ireland), MicroSearch (Yahoo, Spain), Watson (Open University, UK), SWSE (DERI, Ireland), Swoogle (UMBC, USA)Listing on this slide by T. Heath, M. Hausenblas, C. Bizer, R. Cyganiak, O. Hartig19
  • 29.
  • 30.
    Linked Data Mashup(LinkedGeoData)© Migración de datos a la Web de los Datos - Enfoques, técnicas y herramientasLuis Manuel Vilches Blázquez
  • 31.
    Linked Data Mashup(DBpedia Mobile)http://wiki.dbpedia.org/DBpediaMobile© Migración de datos a la Web de los Datos - Enfoques, técnicas y herramientasLuis Manuel Vilches Blázquez
  • 32.
    Linked DataSearch Engines (Sindice and SIG.MA)Entity lookup service. Find a document that mentions a URI or a keyword.
  • 33.
    Linked Data SearchEngines(NYT)The New York Times: Alumni In The Newshttp://data.nytimes.com/schools/schools.html
  • 34.
    Linked Data SearchEngines(NYT)The New York Times: Source code is available… and is based on SPARQL queries
  • 35.
    Oneadditionalmotivation: Open GovernmentGovernmentand state administration should be opened at all levels to effective public scrutiny and oversightObjectives:TransparencyParticipationCollaborationInclusionCost reductionInteroperabilityReusabilityLeadershipMarket & Value26Some Links:
  • 36.
    B. Obama–Transparency and Open Government
  • 37.
    T. Berners-Lee- Raw data now!
  • 38.
    J. ManuelAlonso - ¿Qué es Open Data?
  • 39.
  • 40.
    8 Principles ofOpen Government DataOpen Government. USA and UK27BOTTOM-UPTop-down
  • 41.
    Linked Data Mashup(data.gov)Clean Air Status and Trends (CASTNET)http://data-gov.tw.rpi.edu/demo/exhibit/demo-8-castnet.php
  • 42.
    Linked Data inthe UKEducationhttp://education.data.gov.uk/id/school/106661Parliamenthttp://parliament.psi.enakting.org/id/member/1227MapsE.g., London: http://data.ordnancesurvey.co.uk/id/7000000000041428http://map.psi.enakting.orgTransporthttp://www.dft.gov.uk/naptan/SameAs servicehttp://www.sameas.orgChallengeshttp://gov.tso.co.uk/openup/sparql/gov-transport29
  • 43.
    Linked Data Mashup(data.gov.uk)Research Funding Explorerhttp://bis.clients.talis.com/
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
    Linked Data Mashup(Waterquality)Water quality in Asturias’ beacheshttp://datos.fundacionctic.org/sandbox/asturias/playas/
  • 49.
    ContentsIntroductiontoLinked DataLinked DataFoundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption36
  • 50.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL37
  • 51.
    RDF: Resource DescriptionFrameworkW3C recommendationRDF is graphical formalism ( + XML syntax + semantics)For representing metadataFor describing the semantics of information in a machine- accessible wayResources are described in terms of properties andproperty values using RDF statementsStatements are represented as triples, consisting of asubject, predicate and object. [S, P, O]“Oscar Corcho García”person:hasNameperson:hasColleagueoeg:Oscaroeg:Asunperson:hasHomePageperson:hasColleague“http://www.fi.upm.es/”oeg:Raul38
  • 52.
    RDF and URIsRDFuses URIRefs(Unique Resource IdentifiersReferences) toidentify resourcesA URIRef consists of a URI and an optional FragmentIdentifier separated from the URI by the hash symbol ‘#’Exampleshttp://www.co-ode.org/people#hasColleaguecoode:hasColleagueA set of URIRefs is known as a vocabularyE.g., the RDF Vocabulary The set of URIRefs used indescribing the RDF concepts:rdf:Property,rdf:Resource, rdf:type, etc.The RDFS Vocabulary The set of URIRefs used indescribing the RDF Schema language: rdfs:Class, rdfs:domain, etc.The ‘Pizza Ontology’ Vocabulary pz:hasTopping,pz:Pizza, pz:VegetarianPizza, etc.39
  • 53.
    RDF SerialisationsNormativeRDF/XML (www.w3.org/TR/rdf-syntax-grammar/)Alternative(for human consumption)N3 (http://www.w3.org/DesignIssues/Notation3.html)Turtle (http://www.dajobe.org/2004/01/turtle/)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 meaning40
  • 54.
    RDF Serialisations. RDF/XML<?xmlversion="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:person="http://www.ontologies.org/ontologies/people#" xmlns="http://www.oeg-upm.net/ontologies/people#" xml:base="http://www.oeg-upm.net/ontologies/people"> <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasHomePage"/> <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasColleague"/> <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasName"/> <rdf:Description rdf:about="#Raul"/> <rdf:Description rdf:about="#Asun"> <person:hasColleague rdf:resource="#Raul"/> <person:hasHomePage>http://www.fi.upm.es</person:hasHomePage> </rdf:Description> <rdf:Description rdf:about="#Oscar"> <person:hasColleague rdf:resource="#Asun"/> <person:hasName>Oscar Corcho García</person:hasName> </rdf:Description></rdf:RDF>41
  • 55.
    RDF Serialisations. N3@base <http://www.oeg-upm.net/ontologies/people >@prefix person: <http://www.ontologies.org/ontologies/people#>:Asun person:hasColleague :Raul ; person:hasHomePage “http://www.fi.upm.es/”.:Oscar person:hasColleague :Asun ; person:hasName “Óscar Corcho García”.42
  • 56.
  • 57.
  • 58.
  • 59.
    Takethetextofan RDF fileandcreateitscorrespondinggraph
  • 60.
  • 61.
    Exercise 1.a. Createa graph from a fileOpen the file StickyNote_PureRDF.rdfCreate the corresponding graph from itCompare your graph with those of your colleagues44
  • 62.
  • 63.
    Exercise 1.b. Createfiles from a graphTransform the following graph into N3 syntax46hasMeasurementMeasurement8401Sensor029includeshasTemperatureatTimeClass01includes2010-06-12T12:00:1229Computer101hasOwnerUser10AhasNamePedro
  • 64.
    Blank nodes: structuredproperty valuesMost real-world data involves structures that are more complicated than sets of RDF triple statementsIn RDF/XML, it is an <rdf:Description> node with no rdf:aboutIn N3, it is a resource identifier that starts with ‘_’ E.g., “_:nodeX”Thisintermediate URI doesnotneedtohave a name“Oscar Corcho García”person:hasNameperson:hasPostalAddressoeg:Oscaraddress:hasStreetNameaddress:cityCampus de Montegancedo s/ncity:BoadillaDelMonte47
  • 65.
    Typed literalsSo far,all values have been presented as stringsXML Schema datatypes can be used to specify values (objects in some RDF triple statements)In RDF/XML, this is expressed as:<rdf:Description rdf:about=”#Oscar”> <person:hasBirthDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1976-02-02 </person:hasBirthDate></rdf:Description>In N3, this is expressed as:oeg:Oscar person:hasBirthDate ”1976-02-02”^^xsd:date .person:hasBirthDateoeg:Oscar1976-02-0248
  • 66.
    RDF ContainersThere isoften the need to describe groups of thingsA book was created by several authorsA lesson is taught by several personsetc.RDF provides a container vocabularyrdf:Bag  A group of resources or literals, possibly including duplicate members, where the order of members is not significantrdf:Seq  A group of resources or literals, possibly including duplicate members, where the order of members is significantrdf:Alt  A group of resources or literals that are alternatives (typically for a single value of a property)rdf:typeperson:hasEmailAddressoeg:Oscarrdf:Seqrdf:_2rdf:_1“oscar.corcho@upm.es”“ocorcho@fi.upm.es”49
  • 67.
    RDF ReificationRDF statementsabout other RDF statements“Raúl believes that Oscar’s birthdate is on Feb 2nd, 1976 and that his e-mail address is ocorcho@fi.upm.es”RDF ReificationAllows expressing beliefs (and other modalities)Allows expressing trust models, digital signatures, etc.Allows expressing metadata about metadatamodal:believesoeg:Raúloeg:Oscarperson:hasBirthDateperson:hasEmailAddress02/02/1976“ocorcho@fi.upm.es”50
  • 68.
    Main value ofa structured valueSometimes one of the values of a structured value is the main oneThe weight of an item is 2.4 kilograms The most important value is 2.4, which is expressed with rdf:valueScarcely usedproduct:hasWeightproduct:Item1rdf:valueunits:hasWeightUnitunits:kilogram2.451
  • 69.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL52
  • 70.
    RDF inference. Graphmatching techniques RDF inference is based on graph matching techniquesBasically, the RDF inference process consists of the following steps:Transform an RDF query into a template graph that has to be matched against the RDF graphIt contains constant and variable nodes, and constant and variable edges between nodesMatch against the RDF graph, taking into account constant nodes and edgesProvide a solution for variable nodes and edges53
  • 71.
    RDF inference. Examples(I)Sample RDF graphQuery: “Tell me who are the persons who have Asun as a colleague”Result: oeg:Oscar and oeg:Raúl“Oscar Corcho García”person:hasNameperson:hasColleagueoeg:Oscaroeg:Asunperson:hasHomePageperson:hasColleague“http://www.fi.upm.es/”oeg:Raúlperson:hasColleague?oeg:Asun54
  • 72.
    RDF inference. Examples(II)Query: “Tell me which are the relationships between Oscar and Asun”Result: oeg:hasColleagueQuery: “Tell me the homepage of Oscar colleagues”Result: “http://www.fi.upm.es/”?oeg:Oscaroeg:Asunperson:hasColleagueoeg:Oscarperson:hasHomePage?55
  • 73.
  • 74.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL57
  • 75.
    RDFS: RDF SchemaW3CRecommendationRDF Schema extends RDF to enable talking about classes of resources, and the properties to be used with themClass definition: rdfs:Class, rdfs:subClassOfProperty definition: rdfs:subPropertyOf, rdfs:range, rdfs:domainOther primitives: rdfs:comment, rdfs:label, rdfs:seeAlso, rdfs:isDefinedByRDFS vocabulary adds constraints on models, e.g.:x,y,ztype(x,y) and subClassOf(y,z) type(x,z)ex:Animalrdfs:subClassOfrdf:typeex:Oscarex:Person58
  • 76.
    RDF(S) Serialisations. RDF/XMLsyntax<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:person="http://www.ontologies.org/ontologies/people#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns="http://www.oeg-upm.net/ontologies/people#" xml:base="http://www.oeg-upm.net/ontologies/people"> <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#Professor"> <rdfs:subClassOf> <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#Person"/> </rdfs:subClassOf> </rdfs:Class> <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#Lecturer"> <rdfs:subClassOf rdf:resource="http://www.ontologies.org/ontologies/people#Person"/> </rdfs:Class> <rdfs:Class rdf:about="http://www.ontologies.org/ontologies/people#PhD"> <rdfs:subClassOf rdf:resource="http://www.ontologies.org/ontologies/people#Person"/> </rdfs:Class> …59
  • 77.
    RDF(S) Serialisations. RDF/XMLsyntax… <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasHomePage"/> <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasColleague"> <rdfs:domain rdf:resource=" http://www.ontologies.org/ontologies/people#Person"/> <rdfs:range rdf:resource=" http://www.ontologies.org/ontologies/people#Person"/> </rdf:Property> <rdf:Property rdf:about="http://www.ontologies.org/ontologies/people#hasName"> <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> </rdf:Property> <person:PhD rdf:ID="Raul"/> <person:Professor rdf:ID=“Asun"> <person:hasColleague rdf:resource="#Raul"/> <person:hasHomePage>http://www.fi.upm.es</person:hasHomePage> </person:Professor> <person:Lecturer rdf:ID="Oscar"> <person:hasColleague rdf:resource="#Asun"/> <person:hasName>Óscar Corcho García</person:hasName> </person:Lecturer></rdf:RDF>60
  • 78.
    RDF(S) Serialisations. N3@base <http://www.oeg-upm.net/ontologies/people >@prefix person: <http://www.ontologies.org/ontologies/people#>person:hasColleague a rdf:Property; rdfs:domain person:Person; rdfs:range person:Person.person:Professor rdfs:subClassOf person:Person.person:Lecturer rdfs:subClassOf person:Person.person:PhD rdfs:subClassOf person:Person.:Asun a person:Professor; person:hasColleague :Raul ; person:hasHomePage “http://www.fi.upm.es/”.:Oscar a person:Lecturer; person:hasColleague :Asun ; person:hasName “Óscar Corcho García”.:Raul a person:PhD.a is equivalent to rdf:type61
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
    Exercise 2.a. Createa graph from a fileOpen the files StickyNote.rdf and StickyNote.rdfsCreate the corresponding graph from themCompare your graph with those of your colleagues64
  • 86.
  • 87.
  • 88.
    Exercise 2.b. Createfiles from a graphTransform the following graph into N3 syntax67RoomPersonMeasurementObjecthasMeasurementSensor029includeshasTemperatureatTimeClass01includes2010-06-12T12:00:1229Computer101hasOwnerUser10AhasNamePedro
  • 89.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL68
  • 90.
  • 91.
  • 92.
    RDF(S) limitationsRDFS tooweak to describe resources in sufficient detailNo localised range and domain constraintsCan’t say that the range of hasChild is person when applied to persons and elephant when applied to elephantsNo existence/cardinality constraintsCan’t say that all instances of person have a mother that is also a person, or that persons have exactly 2 parentsNo boolean operatorsCan’t say or, not, etc.No transitive, inverse or symmetrical propertiesCan’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetricalDifficult to provide reasoning supportNo “native” reasoners for non-standard semanticsMay be possible to reason via FOL axiomatisation71
  • 93.
  • 94.
    Understand the featuresof RDF(S) for implementing ontologies, including its limitations
  • 95.
  • 96.
    Given a scenariodescription, build a simple ontology in RDF Schema72
  • 97.
    Exercise 3. DomaindescriptionUn lugar puede ser un lugar de interés.Los lugares de interés pueden ser lugares turísticos o establecimientos, pero no las dos cosas a la vez.Los lugares turísticos pueden ser palacios, iglesias, ermitas y catedrales.Los establecimientos pueden ser hoteles, hostales o albergues.Un lugar está situado en una localidad, la cual a su vez puede ser una villa, un pueblo o una ciudad.Un lugar de interés tiene una dirección postal que incluye su calle y su número.Las localidades tienen un número de habitantes.Las localidades se encuentran situadas en provincias.Covarrubias es un pueblo con 634 habitantes de la provincia de Burgos.El restaurante “El Galo” está situado en Covarrubias, en la calle Mayor, número 5.Una de las iglesias de Covarrubias está en la calle de Santo Tomás.73
  • 98.
    Exercise 3. Sampleresulting ontology74
  • 99.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL75
  • 100.
    Sample RDF APIsRDFlibraries for different languages: Java, Python, C, C++, C#, .Net, Javascript, Tcl/Tk, PHP, Lisp, Obj-C, Prolog, Perl, Ruby, HaskellList in http://esw.w3.org/topic/SemanticWebToolsUsually related to a RDF repositoryMultilanguage:Redland RDF Application Framework (C, Perl, PHP, Python and Ruby): http://www.redland.opensource.ac.uk/Java:Jena: http://jena.sourceforge.net/Sesame: http://www.openrdf.org/PHP:RAP - RDF API for PHP: http://www4.wiwiss.fu-berlin.de/bizer/rdfapi/Python:RDFLib: http://rdflib.net/Pyrple: http://infomesh.net/pyrple/76
  • 101.
    JenaJava framework forbuilding Semantic Web applicationsOpen source software from HP LabsThe Jena framework includes:A RDF APIAn OWL APIReading and writing RDF in RDF/XML, N3 and N-TriplesIn-memory and persistent storageA rule based inference engineSPARQL query engine77
  • 102.
    SesameA framework forstorage, querying and inferencing of RDF and RDF SchemaA Java Library for handling RDFA Database Server for (remote) access to repositories of RDF dataHighly expressive query and transformation languagesSeRQL, SPARQLVarious backendsNative StoreRDBMS (MySQL, Oracle 10, DB2, PostgreSQL)main memoryReasoning supportRDF Schema reasonerOWL DLP (OWLIM)domain reasoning (custom rule engine)78
  • 103.
    Jena example. Graphcreationhttp://.../JohnSmithvcard:FNvcard:NJohn Smithvcard:Givenvcard:FamilySmithJohn// 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)); 79
  • 104.
    Jena example. Readand write// create an empty modelModel model = ModelFactory.createDefaultModel();// use the FileManager to find the input fileInputStream in = FileManager.get().open( inputFileName );if (in == null) { throw new IllegalArgumentException("File not found");}// read the RDF/XML filemodel.read(in, "");// write it to standard outmodel.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:Description>...</rdf:RDF>80
  • 105.
  • 106.
    Main ReferencesBrickley D,Guha RV (2004) RDF Vocabulary Description Language 1.0: RDF Schema. W3C Recommendationhttp://www.w3.org/TR/PR-rdf-schema/Lassila O, Swick R (1999) Resource Description Framework (RDF) Model and Syntax Specification. W3C Recommendation http://www.w3.org/TR/REC-rdf-syntax/RDF validator: http://www.w3.org/RDF/Validator/RDF resources:http://planetrdf.com/guide/82
  • 107.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL83
  • 108.
    RDF(S) query languagesLanguagesdeveloped to allow accessing datasets expressed in RDF(S) (and in some cases OWL)Supported by the most important language APIsJena (HP labs)Sesame (Aduna)Boca (IBM)...There are some differences wrt. languages like SQL, such asCombination of different sourcesTrust managementOpen World Assumption84ApplicationApplicationSQL queriesSPARQL, RQL, etc., queriesRelationalDBRDF(S)OWL
  • 109.
    Query typesSelection andextraction“Select all the essays, together with their authors and their authors’ names”“Select everything that is related to the book ‘Bellum Civille’” Reduction: we specify what it should not be returned“Select everything except for the ontological information and the book translators”Restructuring: the original structure is changed in the final result“Invert the relationship ‘author’ by ‘is author of’”Aggregation“Return all the essays together with the mean number of authors per essay”Combination and inferences“Combine the information of a book called ‘La guerra civil’ and whose author is Julius Caesar with the book whose identifier is ‘Bellum Civille’”“Select all the essays, together with its authors and author names”, including also the instances of the subclasses of Essay“Obtain the relationship ‘coauthor’ among persons who have written the same book”85
  • 110.
    RDF(S) query languagefamiliesSPARQL W3C Recommendation 15 January 2008Description graphsQuery semanticsTriple database Query structureSquishQLFamilySquishQLrdfDB Query LanguageRDQLBRQLTriQLXPath, XSLT, XQueryXQueryfor RDFXsRQLTreeHuggerandRDFTwigRDFT, Nexus Query LanguageRDFPath, RpathandRXPathVersaRQL FamilyRQLSeRQLeRQLControlled natural languageMetalogOtherAlgaeiTQLN3QLPerlRDF Query LanguageRDEVICE DeductiveLanguageRDFQBERDFQLTRIPLEWQLXML repository Query syntax86
  • 111.
    SPARQLSPARQL Protocol andRDF Query LanguageSupported by: Jena, Sesame, IBM Boca, etc.FeaturesItsupportsmostoftheaforementionedqueriesItsupportsdatatypereasoning(datatypes can be requestedinsteadof actual values)Thedomainvocabularyandtheknowledgerepresentationvocabularyare treateddifferently by thequeryinterpretersItallowsmakingqueriesoverpropertieswithmultiplevalues, overmultiplepropertiesof a resourceandoverreificationsQueries can containoptionalstatementsSomeimplementationssupportaggregationqueriesLimitationsNeitherset operationsnorexistentialor universal quantifierscan be included in thequeriesItdoesnotsupportrecursivequeries87
  • 112.
    SPARQL is alsoa protocolSPARQL is a Query Language …Find names and websites of contributors to PlanetRDF: PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?website FROM <http://planetrdf.com/bloggers.rdf> WHERE { ?person foaf:weblog ?website . ?person foaf:name ?name . ?website a foaf:Document }... and a Protocolhttp://.../qps?query-lang=http://www.w3.org/TR/rdf-sparql-query/ &graph-id=http://planetrdf.com/bloggers.rdf&query=PREFIXfoaf: <http://xmlns.com/foaf/0.1/...Services running SPARQL queries over a set of graphs A transport protocol for invoking the service Based on ideas from earlier protocol work such as JosekiDescribing the service with Web Service technologies 88
  • 113.
    SPARQL EndpointsSPARQL protocolservicesEnables users (human or other) to query a knowledge base using SPARQLResults are typically returned in one or more machine-processable formatsList of SPARQL Endpointshttp://esw.w3.org/topic/SparqlEndpointsProgrammatic access using libraries:ARC, RAP, Jena, Sesame, Javascript SPARQL, PySPARQL, etc.Examples:89
  • 114.
    Example: Querying dbpediaPeoplewho were born in Berlin before 190090
  • 115.
    A simple SPARQLqueryData:@prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix : <http://example.org/book/> . :book1 dc:title "SPARQL Tutorial" .Query:SELECT ?titleWHERE{ <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title .}Query result:A pattern is matched against the RDF data
  • 116.
    Each way apattern can be matched yields a solution
  • 117.
    The sequence ofsolutions is filtered by: Project, distinct, order, limit/offset
  • 118.
    One of theresult forms is applied: SELECT, CONSTRUCT, DESCRIBE, ASK91
  • 119.
    Graph patternsBasic GraphPatterns, where a set of triple patterns must matchGroup Graph Pattern, where a set of graph patterns must all matchOptional Graph patterns, where additional patterns may extend the solutionAlternative Graph Pattern, where two or more possible patterns are triedPatterns on Named Graphs, where patterns are matched against named graphs92
  • 120.
    @prefix foaf: <http://xmlns.com/foaf/0.1/> ._:a foaf:name "Johnny Lee Outlaw" ._:a foaf:mbox <mailto:jlow@example.com> ._:bfoaf:name "Peter Goodguy" ._:bfoaf:mbox <mailto:peter@example.org> ._:cfoaf:mbox <mailto:carol@example.org> .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE { ?x foaf:name ?name . ?x foaf:mbox ?mbox }Multiple matches93
  • 121.
    @prefix dt: <http://example.org/datatype#> .@prefix ns: <http://example.org/ns#> .@prefix : <http://example.org/ns#> .@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .:x ns:p "cat"@en .:y ns:p "42"^^xsd:integer .:z ns:p "abc"^^dt:specialDatatype .SELECT ?v WHERE { ?v ?p "cat" }SELECT ?v WHERE { ?v ?p "cat"@en }SELECT ?v WHERE { ?v ?p 42 }SELECT ?v WHERE { ?v ?p "abc"^^<http://example.org/datatype#specialDatatype> }Matching RDF literals94
  • 122.
    @prefix foaf: <http://xmlns.com/foaf/0.1/> ._:a foaf:name "Alice" ._:bfoaf:name "Bob" .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?x ?nameWHERE { ?x foaf:name ?name }=Blank node labels in query results95
  • 123.
    Group graph patternPREFIXfoaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE { { ?xfoaf:name ?name . } { ?xfoaf:mbox ?mbox . } }SELECT ?xWHERE {}PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE { { ?x foaf:name ?name . } { ?x foaf:mbox ?mbox . FILTER regex(?name, "Smith")} }96
  • 124.
    Optional graph patterns@prefixfoaf: <http://xmlns.com/foaf/0.1/> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ._:a rdf:typefoaf:Person ._:a foaf:name "Alice" ._:a foaf:mbox <mailto:alice@example.com> ._:a foaf:mbox <mailto:alice@work.example> ._:brdf:typefoaf:Person ._:bfoaf:name "Bob" .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mboxWHERE { ?x foaf:name ?name .OPTIONAL { ?x foaf:mbox ?mbox } }97
  • 125.
    Multiple optional graphpatterns@prefix foaf: <http://xmlns.com/foaf/0.1/> ._:a foaf:name "Alice" ._:a foaf:homepage <http://work.example.org/alice/> ._:bfoaf:name "Bob" ._:bfoaf:mbox <mailto:bob@work.example> .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?name ?mbox ?hpageWHERE { ?x foaf:name ?name .OPTIONAL { ?x foaf:mbox ?mbox } . OPTIONAL { ?x foaf:homepage ?hpage } }98
  • 126.
    Alternative graph patterns@prefixdc10: <http://purl.org/dc/elements/1.0/> .@prefix dc11: <http://purl.org/dc/elements/1.1/> ._:a dc10:title "SPARQL Query Language Tutorial" ._:a dc10:creator "Alice" ._:b dc11:title "SPARQL Protocol Tutorial" ._:b dc11:creator "Bob" ._:c dc10:title "SPARQL" ._:c dc11:title "SPARQL (updated)" .PREFIX dc10: <http://purl.org/dc/elements/1.0/>PREFIX dc11: <http://purl.org/dc/elements/1.1/>SELECT ?titleWHERE { { ?book dc10:title ?title } UNION { ?book dc11:title ?title } }SELECT ?x ?yWHERE { { ?book dc10:title ?x } UNION { ?book dc11:title ?y } }SELECT ?title ?authorWHERE { { ?book dc10:title ?title . ?book dc10:creator ?author }UNION { ?book dc11:title ?title . ?book dc11:creator ?author }}99
  • 127.
    Patterns on namedgraphs# Named graph: http://example.org/foaf/aliceFoaf@prefix foaf:<http://.../foaf/0.1/> .@prefix rdf:<http://.../1999/02/22-rdf-syntax-ns#> .@prefix rdfs:<http://.../2000/01/rdf-schema#> ._:a foaf:name "Alice" ._:a foaf:mbox <mailto:alice@work.example> ._:a foaf:knows _:b ._:b foaf:name "Bob" ._:b foaf:mbox <mailto:bob@work.example> ._:b foaf:nick "Bobby" ._:b rdfs:seeAlso <http://example.org/foaf/bobFoaf> .<http://example.org/foaf/bobFoaf> rdf:type foaf:PersonalProfileDocument .# Named graph: http://example.org/foaf/bobFoaf@prefix foaf:<http://.../foaf/0.1/> .@prefix rdf:<http://.../1999/02/22-rdf-syntax-ns#> .@prefix rdfs:<http://.../2000/01/rdf-schema#> ._:z foaf:mbox <mailto:bob@work.example> ._:z rdfs:seeAlso <http://example.org/foaf/bobFoaf> ._:z foaf:nick "Robert" .<http://example.org/foaf/bobFoaf> rdf:type foaf:PersonalProfileDocument .100
  • 128.
    Patterns on namedgraphs IIPREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?src ?bobNickFROM NAMED <http://example.org/foaf/aliceFoaf>FROM NAMED <http://example.org/foaf/bobFoaf>WHERE {GRAPH ?src { ?xfoaf:mbox <mailto:bob@work.example> . ?xfoaf:nick ?bobNick } }PREFIX foaf: <http://xmlns.com/foaf/0.1/>PREFIX data: <http://example.org/foaf/>SELECT ?nickFROM NAMED <http://example.org/foaf/aliceFoaf>FROM NAMED <http://example.org/foaf/bobFoaf>WHERE {GRAPH data:bobFoaf { ?x foaf:mbox <mailto:bob@work.example> . ?x foaf:nick ?nick } }101
  • 129.
    Restricting values@prefix dc: <http://purl.org/dc/elements/1.1/> .@prefix : <http://example.org/book/> .@prefix ns: <http://example.org/ns#> .:book1 dc:title "SPARQL Tutorial" .:book1 ns:price 42 .:book2 dc:title "The Semantic Web" .:book2 ns:price 23 .PREFIX dc: <http://purl.org/dc/elements/1.1/>SELECT ?titleWHERE { ?x dc:title ?titleFILTER regex(?title, "^SPARQL") }PREFIX dc: <http://purl.org/dc/elements/1.1/>SELECT ?titleWHERE { ?x dc:title ?titleFILTER regex(?title, "web", "i" ) }PREFIX dc: <http://purl.org/dc/elements/1.1/>PREFIX ns: <http://example.org/ns#>SELECT ?title ?priceWHERE { ?x ns:price ?price .FILTER (?price < 30.5) ?x dc:title ?title . }102
  • 130.
    Value testsBased onXQuery 1.0 and XPath 2.0 Function and Operators XSD boolean, string, integer, decimal, float, double, dateTime Notation <, >, =, <=, >= and != for value comparisonApply to any type BOUND, isURI, isBLANK, isLITERAL REGEX, LANG, DATATYPE, STR (lexical form) Function call for casting and extensions functions 103
  • 131.
    Solution sequences andmodifiersSELECT ?nameWHERE { ?x foaf:name ?name ; :empId ?emp }ORDER BY ?name DESC(?emp)Order modifier: put the solutions in orderProjection modifier: choose certain variablesDistinct modifier: ensure solutions in the sequence are uniqueReduced modifier: permit elimination of some non-unique solutionsLimit modifier: restrict the number of solutionsOffset modifier: control where the solutions start from in the overall sequence of solutionsSELECT ?nameWHERE { ?x foaf:name ?name }SELECT DISTINCT ?name WHERE { ?x foaf:name ?name }SELECT REDUCED ?name WHERE { ?x foaf:name ?name }SELECT ?nameWHERE { ?x foaf:name ?name }LIMIT 20SELECT ?name WHERE { ?x foaf:name ?name }ORDER BY ?nameLIMIT 5OFFSET 10104
  • 132.
    SPARQL query formsSELECTReturnsall, or a subset of, the variables bound in a query pattern matchCONSTRUCTReturns an RDF graph constructed by substituting variables in a set of triple templatesASKReturns a boolean indicating whether a query pattern matches or notDESCRIBEReturns an RDF graph that describes the resources found105
  • 133.
    SPARQL query forms:SELECT@prefix foaf: <http://xmlns.com/foaf/0.1/> ._:a foaf:name "Alice" ._:a foaf:knows _:b ._:a foaf:knows _:c ._:bfoaf:name "Bob" ._:cfoaf:name "Clare" ._:cfoaf:nick "CT" .PREFIX foaf: <http://xmlns.com/foaf/0.1/>SELECT ?nameX ?nameY ?nickYWHERE { ?x foaf:knows ?y ; foaf:name ?nameX . ?y foaf:name ?nameY . OPTIONAL { ?y foaf:nick ?nickY } }106
  • 134.
    @prefix foaf: <http://xmlns.com/foaf/0.1/> ._:a foaf:name "Alice" ._:a foaf:mbox <mailto:alice@example.org> .PREFIX foaf: <http://xmlns.com/foaf/0.1/>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>CONSTRUCT { <http://example.org/person#Alice> vcard:FN ?name }WHERE { ?x foaf:name ?name }Query result:@prefix vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> .<http://example.org/person#Alice> vcard:FN "Alice" .SPARQL query forms: CONSTRUCT107
  • 135.
    SPARQL query forms:ASK@prefix foaf: <http://xmlns.com/foaf/0.1/> ._:a foaf:name "Alice" ._:a foaf:homepage <http://work.example.org/alice/> ._:b foaf:name "Bob" ._:b foaf:mbox <mailto:bob@work.example> .PREFIX foaf: <http://xmlns.com/foaf/0.1/>ASK { ?xfoaf:name "Alice" }Query result:yes108
  • 136.
    PREFIX ent: <http://org.example.com/employees#>DESCRIBE ?x WHERE { ?xent:employeeId "1234" }Query result:@prefix foaf: <http://xmlns.com/foaf/0.1/> .@prefix vcard: <http://www.w3.org/2001/vcard-rdf/3.0> .@prefix exOrg: <http://org.example.com/employees#> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix owl: <http://www.w3.org/2002/07/owl#>_:a exOrg:employeeId "1234" ; foaf:mbox_sha1sum "ABCD1234" ; vcard:N [ vcard:Family "Smith" ; vcard:Given "John" ] .foaf:mbox_sha1sum rdf:type owl:InverseFunctionalProperty .SPARQL query forms: DESCRIBE109
  • 137.
    Main ReferencesPrud’hommeaux E,Seaborne A (2008) SPARQL Query Language for RDF. W3C Recommendation http://www.w3.org/TR/rdf-sparql-query/SPARQL validator: http://www.sparql.org/validator.htmlSPARQL implementations: http://esw.w3.org/topic/SparqlImplementationsSPARQL Endpoints http://esw.w3.org/topic/SparqlEndpointsSPARQL in Dbpediahttp://dbpedia.org/sparql110
  • 138.
    IndexResourceDescription Framework (RDF)RDFprimitivesReasoningwith RDFRDF SchemaRDF SchemaprimitivesReasoningwith RDFSRDF(S) Management APIsSPARQLOWL111
  • 139.
    Description LogicsA familyof logic based Knowledge Representation formalismsDescendants of semantic networks and KL-ONEDescribe domain in terms of concepts (classes), roles (relationships) and individualsSpecificlanguagescharacterisedbytheconstructors and axiomsusedtoassertknowledgeaboutclasses, roles and individuals.Example: ALC (theleastexpressivelanguage in DL thatispropositionallyclosed)Constructors: boolean(and, or, not)Role restrictionsDistinguished by:Model theoretic semanticsDecidable fragments of FOLClosely related to Propositional Modal & Dynamic LogicsProvision of inference servicesSound and complete decision procedures for key problemsImplemented systems (highly optimised)
  • 140.
    Structure of DLOntologiesA DL ontology can be divided into two parts:Tbox (Terminological KB): a set of axioms that describe the structure of a domain :Doctor  PersonPerson  Man  WomanHappyFather  Man  hasDescendant.(Doctor  hasDescendant.Doctor)Abox (Assertional KB): a set of axioms that describe a specific situation :John  HappyFather hasDescendant (John, Mary)
  • 141.
    Mostcommonconstructors in classdefinitionsIntersection:C1 ...  Cn Human  MaleUnion: C1  ...  Cn Doctor  LawyerNegation: C MaleNominals: {x1}  ...  {xn} {john}  ...  {mary}Universal restriction: P.C hasChild.DoctorExistentialrestriction: P.C hasChild.LawyerMaximumcardinality: nP.C 3hasChild.DoctorMinimumcardinality: nP.C 1hasChild.MaleSpecificValue: P.{x} hasColleague.{Matthew}Nesting of constructors can bearbitrarilycomplexPerson hasChild.(Doctor hasChild.Doctor)Lots of redundancyAB is equivalent to ( A  B)P.C is equivalent to P. C
  • 142.
    OWL (1.0 and1.1)February 2004Web Ontology LanguageBuilt on top of RDF(S)Three layers: OWL Lite
  • 143.
    A smallsubset of primitives
  • 144.
    Easier forframe-based tools to transition to
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
    RDF extension,allows metaclassesSeveral syntaxes: Abstract syntax
  • 150.
  • 151.
    RDF/XMLOWL 2(I). New featuresOctober 2009New featuresSyntactic sugarDisjoint union of classesNew expressivityKeysProperty chainsRicher datatypes, data rangesQualified cardinality restrictionsAsymmetric, reflexive, and disjoint propertiesEnhanced annotation capabilities New syntaxOWL2 Manchester syntax
  • 152.
    OWL 2 (II).Three new profilesOWL2 ELOntologies that define very large numbers of classes and/or properties, Ontology consistency, class expression subsumption, and instance checking can be decided in polynomial time. OWL2 QLSound and complete query answering is in LOGSPACE (more precisely, in AC0) with respect to the size of the data (assertions),Provides many of the main features necessary to express conceptual models (UML class diagrams and ER diagrams). It contains the intersection of RDFS and OWL 2 DL.OWL2 RLInspired by Description Logic Programs and pD*. Syntactic subset of OWL 2 which is amenable to implementation using rule-based technologies, and presenting a partial axiomatization of the OWL 2 RDF-Based Semantics in the form of first-order implications that can be used as the basis for such an implementation. Scalable reasoning without sacrificing too much expressive power. Designed forOWL applications trading the full expressivity of the language for efficiency, RDF(S) applications that need some added expressivity from OWL 2.
  • 153.
    OWL: Most commonconstructorsIntersection: C1 ...  CnintersectionOf Human  MaleUnion: C1  ...  CnunionOf Doctor  LawyerNegation: C complementOf MaleNominals: {x1}  ...  {xn} oneOf {john}  ...  {mary}Universal restriction: P.C allValuesFrom hasChild.DoctorExistentialrestriction: P.C someValuesFrom hasChild.LawyerMaximumcardinality: nP[.C] maxCardinality (qualifiedornot) 3hasChild[.Doctor]Minimumcardinality: nP[.C] minCardinality (qualifiedornot) 1hasChild[.Male]Exactcardinality: =nP[.C] exactCardinality (qualifiedornot) =1hasMother[.Female]SpecificValue: P.{x} hasValue hasColleague.{Matthew}Local reflexivity: -- hasSelfNarcisist  Person  hasSelf(loves)Keys -- hasKeyhasKey(Person, passportNumber, country)Subclass C1  C2 subClassOf Human  Animal  BipedEquivalence C1  C2 equivalentClass Man  Human  MaleDisjointness C1  C2   disjointWith, AllDisjointClasses Male  Female  DisjointUnion C  C1  ...  Cn and Ci Cj   foralli≠jdisjointUnionOf Person DisjointUnionOf (Man, Woman)Metaclasses and annotations on axioms are also valid in OWL2, and declarations of classes have to provided.Full list available in reference specs and in the Quick Reference Guide: http://www.w3.org/2007/OWL/refcard
  • 154.
    OWL: Most commonconstructorsSubproperty P1  P2 subPropertyOf hasDaughter  hasChildEquivalence P1  P2 equivalentProperty cost  priceDisjointProperties P1  ...  Pn   disjointObjectProperties hasDaughter  hasSon  Inverse P1  P2- inverseOf hasChild  hasParent-Transitive P+  P TransitiveProperty ancestor+  ancestorFunctional   1P FunctionalProperty T  1hasMotherInverseFunctional   1P- InverseFunctionalProperty T  1hasPassportID-Reflexive ReflexivePropertyIrreflexive IrreflexivePropertyAsymmetric AsymmetricPropertyProperty chains P  P1 o ... o Pn propertyChainAxiom hasUncle  hasFather o hasBrotherEquivalence {x1}  {x2} sameIndividualAs {oeg:OscarCorcho}{img:Oscar}Different {x1}  {x2} differentFrom, AllDifferent {john}  {peter}NegativePropertyAssertion NegativeDataPropertyAssertion {hasAge john 35}NegativeObjectPropertyAssertion {hasChild john peter}Besides, top and bottom object and datatype properties exist
  • 155.
    Basic Inference TasksSubsumption– check knowledge is correct (captures intuitions)Does C subsume D w.r.t. ontology O? (in every modelI of O, CIDI )Equivalence – check knowledge is minimally redundant (no unintended synonyms)Is C equivalent to D w.r.t. O? (in every modelI of O, CI = DI )Consistency – check knowledge is meaningful (classes can have instances)Is C satisfiable w.r.t. O? (there exists some modelI of O s.t. CI)Instantiation and queryingIs x an instance of C w.r.t. O? (in every modelI of O, xICI )Is (x,y) an instance of R w.r.t. O? (in every modelI of O, (xI,yI) RI )All reducible to KB satisfiability or concept satisfiability w.r.t. a KBCan be decided using highly optimised tableaux reasoners
  • 156.
    MainReferences W3C OWL Working Group (2009) OWL2 Web Ontology Language Document Overview. http://www.w3.org/TR/2009/REC-owl2-overview-20091027/ Dean M, Schreiber G (2004) OWL Web Ontology Language Reference. W3C Recommendation. http://www.w3.org/TR/owl-ref/Gómez-Pérez, A.; Fernández-López, M.; Corcho, O. Ontological Engineering. Springer Verlag. 2003 Capítulo 4: Ontology languagesBaader F, McGuinness D, Nardi D, Patel-Schneider P (2003) The Description Logic Handbook: Theory, implementation and applications. Cambridge University Press, Cambridge, United KingdomJena web site:http://jena.sourceforge.net/Jena API: http://jena.sourceforge.net/tutorial/RDF_API/Jena tutorials:http://www.ibm.com/developerworks/xml/library/j-jena/index.htmlhttp://www.xml.com/pub/a/2001/05/23/jena.htmlPellet: http://clarkparsia.com/pellet RACER: http://www.racer-systems.com/FaCT++: http://owl.man.ac.uk/factplusplus/HermIT: http://hermit-reasoner.com/
  • 157.
    ContentsIntroductiontoLinked DataLinked DataFoundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption122
  • 158.
    MethodologicalguidelinesforLinked Data publicationMotivationRelatedWorkGeoLinkedDataIdentification of the data sourcesVocabulary DevelopmentGeneration of the RDF dataPublication of the RDF dataData cleansingLinking the RDF dataEnable effective discoveryFuture Work
  • 159.
    GeoLinkedDataIt is anopen initiative whose aim is to enrich the Web of Data with Spanish geospatial data.This initiative has started off by publishing diverse information sources, such as National Geographic Institute of Spain (IGN-E) and National Statistics Institute (INE)http://geo.linkeddata.es
  • 160.
    Motivation 99.171 % English 0.019% SpanishThe Web of Data ismainlyforEnglishspeakersPoorpresence of SpanishSource:Billion Triples dataset at http://km.aifb.kit.edu/projects/btc-2010/Thanks to Aidan and Richard
  • 161.
  • 162.
    Impact of Geo.linkeddata.esNúmerode tripletas en Español (July): 1.412.248 Número de tripletas en Español (End august): 21.463.088127Asunción Gómez Pérez
  • 163.
    Processfor Publishing LinkedData onthe WebIdentificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
  • 164.
    1. Identification andselection of the data sourcesIdentificationof the data sourcesInstituto GeográficoNacionalVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataInstituto Nacionalde EstadísticaEnable effective discovery
  • 165.
    1. Identification andselection of the data sourcesInstituto Geográfico Nacional (GeographicSpanishInstitute)Multilingual (Spanish, Vasc, Gallician, Catalan)ConceptualizationmistmatchesGranularity (scale concept)Textual informationParticularatiesLongitudelatitudeInstituto Nacional de Estadística (StatisticSpanishInstitute)
  • 166.
  • 167.
  • 168.
  • 169.
    1. Identification andselection of the data sourcesIGN-E
  • 170.
    1. Identification andselection of the data sourcesIndustryProductionIndexYearProvince
  • 171.
    2. Vocabulary developmenthttp://www4.wiwiss.fu-berlin.de/bizer/pub/LinkedDataTutorial/#whichvocabsIdentificationofthe data sourcesVocabularydevelopmentGenerationof the RDF DataThisisnotenoughPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
  • 172.
    2. VocabularydevelopmentFeaturesLightweight :Taxonomies and a fewpropertiesConsensuatedvocabulariesToavoidthemappingproblemsMultilingualLinked data are multilingualTheNeOnmethodology can helptoRe-enginer Non ontologicalresourcesintoontologiesPros: use domainterminologyalreadyconsensuatedbydomainexpertsWithdraw in heavyweightontologiesthosefeaturesthatyoudon’tneedReuseexistingvocabularies134Identificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discoveryAsunción Gómez Pérez
  • 173.
    Knowledge ResourcesOntological ResourcesO.Design Patterns34O. Repositories and Registries56FlogicRDF(S)OWLOntologicalResourceReuse O. Aligning O. Merging562Ontology DesignPattern ReuseNon Ontological ResourceReuse436Non Ontological Resources2Ontological ResourceReengineering7GlossariesDictionariesLexicons5Non Ontological ResourceReengineering46ClassificationSchemasThesauriTaxonomiesAlignments2RDF(S)1FlogicO. ConceptualizationO. ImplementationO. FormalizationO. SpecificationSchedulingOWL8Ontology Restructuring(Pruning, Extension, Specialization, Modularization)9O. Localization1,2,3,4,5,6,7,8, 9Ontology Support Activities: Knowledge Acquisition (Elicitation); Documentation; Configuration Management; Evaluation (V&V); Assessment135
  • 174.
    Vocabularydevelopment: SpecificationContent requirements:Identifythe set of questionsthattheontologyshouldanswerWhichone are theprovinces in Spain?Where are thebeaches?Where are thereservoirs?Identifytheproductionindex in MadridWhichoneisthecitywithhigherproductionindex?Give me Madrid latitude and altitude….Non-contentrequirementsTheontologymustbe in thefourofficialSpanishlanguages136Asunción Gómez Pérez
  • 175.
    2. Lightweight OntologyDevelopmentWGS84 Geo Positioning: an RDF vocabularyscv:Dimensionscv:Itemscv:Datasethydrographical phenomena (rivers, lakes, etc.)Vocabulary for instants, intervals, durations, etc.Names and international code systems for territories and groupsOntology for OGC Geography Markup Language reusedFollowing the INSPIRE (INfrastructure for SPatial InfoRmation in Europe) recommendation.hydrOntology,SCOVO, FAO Geopolitcal, WGS84, GML, and Time
  • 176.
    Objetivos:INSPIRE intenta conseguirfuentes armonizadas de Información Geográfica para dar soporte a la formulación, implementación y evaluación de políticas comunitarias (Medio Ambiente, etc).Fuentes de Información Geográfica: Bases de datos de los Estados Miembros (UE) a nivel local, regional, nacional e internacional.Contexto – Directiva INSPIRE Luis Manuel Vilches Blázquez
  • 177.
    INSPIRE - AnexosLuisManuel Vilches Blázquez
  • 178.
    hydrOntologyExistencia de grandiversidad de problemas (múltiples fuentes, heterogeneidad de contenido y estructuración, ambigüedad del lenguaje natural, etc.) en la información geográfica.Necesidad de un modelo compartido para solventar los problemas de armonización y estructuración de la información hidrográfica.hydrOntology es una ontología global de dominio desarrollada conforme a un acercamiento top-down. Recubrir la mayoría de los fenómenos representables cartográficamente asociados al dominio hidrográfico.Servir como marco de armonización entre los diferentes productores de información geo-espacial en el entorno nacional e internacional.Comenzar con los pasos necesarios para obtener una mejor organización y gestión de la información geográfica (hidrográfica).Luis Manuel Vilches Blázquez
  • 179.
    FuentesTesauros y BibliografíaCatálogosde fenómenosGettyFTT ADLBCN25GEMETWFDCC.AA.EGM & ERMDiccionarios yMonografíasBCN200Nomenclátor Geográfico NacionalNomenclátor ConcisoLuis Manuel Vilches Blázquez
  • 180.
    Criterios de estructuraciónDirectiva Marco del AguaPropuesta por Parlamento y Consejo de la UELista de definiciones de fenómenos hidrográficosProyecto SDIGERProyecto piloto INSPIREDos cuencas, países e idiomasCriterios semánticosDiccionarios geográficosDiccionario de la Real Academia de la LenguaWordNetWikipediaBibliografía de varias áreas de conocimientoHerencia: Estructuración actual de catálogosAsesoramiento expertos en toponimia del IGNLuis Manuel Vilches Blázquez
  • 181.
    Modelización deldominio hidrográfico Luis Manuel Vilches Blázquez
  • 182.
    Implementación & Formalizacón+ Pellet41253+150 conceptos (classes) , 47 tipos de relaciones (properties) y 64 tipos de atributos (attribute types)Luis Manuel Vilches Blázquez
  • 183.
  • 184.
    3. Generation ofRDFFrom the Data sourcesGeographic information (Databases)Statistic information (.xsl)Geospatial information Different technologies for RDF generationReengineering patternsR20 and ODEMapsterAnnotation toolsGeometry generationIdentificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
  • 185.
    3. Generation ofthe RDF DataNOR2OINEODEMapsterIGNGeometry2RDFGeospatialcolumnIGN
  • 186.
    3. Generation ofthe RDF Data / instances NOR2O is a software librarythatimplementsthetransformationsproposedbythePatternsfor Re-engineering Non-OntologicalResources (PR-NOR). Currentlywehave 16 PR-NORs.PR-NORs define a procedurethattransforms a Non-OntologicalResource (NOR) componentsintoontologyelements. http://ontologydesignpatterns.org/· ClassificationschemesNOR2O· Thesauri· LexiconsNOR2OFAO Water classification· Classification scheme· Path enumeration data model· Implemented in a database
  • 187.
    Re-engineeringModelforNORsPatterns for Re-engineeringNon-OntologicalResources (PR-NOR)Ontology Forward Engineering Con-ceptualSpeci-ficationNOR Reverse EngineeringConceptua-lizationTransformationRequirementsFormalizationDesignImplementationImplementationRDF(S)Non-Ontological ResourceOntology
  • 188.
    PR-NOR library atthe ODP PortalTechnologicalsupporthttp://ontologydesignpatterns.org/wiki/Submissions:ReengineeringODPs
  • 189.
    3. Generation ofthe RDF Data – NOR2ONOR2OYearIndustry Production IndexProvince
  • 190.
    hydrOntology & Basesde DatosNGN1:25.000multilingüe© Migración de datos a la Web de los Datos - Enfoques, técnicas y herramientasLuis Manuel Vilches Blázquez
  • 191.
    3. Generation ofthe RDF Data – R2O & ODEMapsterCreation of the R2O Mappings
  • 192.
    3. Generation ofthe RDF Data – Geometry2RDFOracle STO UTIL package SELECT TO_CHAR(SDO_UTIL.TO_GML311GEOMETRY(geometry)) AS Gml311GeometryFROM "BCN200"."BCN200_0301L_RIO" cWHERE c.Etiqueta='Arroyo'
  • 193.
    3. Generation ofthe RDF Data – Geometry2RDF
  • 194.
    3. Generation ofthe RDF Data – Geometry2RDF
  • 195.
    3. Generation ofthe RDF data – RDF graphs IGN INESo far 7 RDF Named Graphs 1.412.248 triplesBTN25BCN200IPI….http://geo.linkeddata.es/dataset/IGN/BTN25http://geo.linkeddata.es/dataset/IGN/BCN200http://geo.linkeddata.es/dataset/INE/IPI
  • 196.
    4. Publication ofthe RDF DataIdentificationof the data sourcesVocabularydevelopmentSPARQLLinked DataHTMLGenerationof the RDF DataIncludingProvenanceSupportPublicationof the RDF data PubbyPubby 0.3Data cleansingLinking the RDF dataEnable effective discoveryVirtuoso 6.1.0
  • 197.
    4. Publication ofthe RDF Data
  • 198.
    4. Publication ofthe RDF Data - LicenseLicense for GeoLinkedDataCreative Commons Attribution-ShareAlike 3.0 GNU Free Documentation LicenseEach dataset will have its own specific license, IGN, INE, etc.
  • 199.
    5. Data cleansingIdentificationofthe data sourcesLack of documentation of the IGN datasetsBroken links: Spain, IGN resourcesLack of documentation of theontologyMissingenglish and spanishlabelsBuilding a spanish ontology and importing some concepts of other ontology (in English):Importing the English ontology. Add annotations like a Spanish label to them.Importing the English ontology, creating new concepts and properties with a Spanish name and map those to the English equivalents.Re-declaring the terms of the English ontology that we need (using the same URI as in the English ontology), and adding a Spanish label.Creating your own class and properties that model the same things as the English ontology. VocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
  • 200.
    5. Data cleansingURIsin Spanishhttp://geo.linkeddata.es/ontology/RíoRDF allows UTF-8 characters for URIsBut, Linked Data URIs has to be URLs as wellSo, non ASCII-US characters have to be %codehttp://geo.linkeddata.es/ontology/R%C3%ADo
  • 201.
    6. Linking ofthe RDF DataIdentificationof the data sourcesSilk - A Link Discovery Framework for the Web of DataFirst set of links: Provinces of Spain86% accuracyVocabularydevelopmentGeonamesGenerationof the RDF DataGeoLinkedDataDBPediaPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
  • 202.
    6. Linking ofthe RDF Datahttp://geo.linkeddata.es/page/Provincia/Granada164Asunción Gómez Pérez
  • 203.
    7. Enable effectivediscoveryIdentificationof the data sourcesVocabularydevelopmentGenerationof the RDF DataPublicationof the RDF data Data cleansingLinking the RDF dataEnable effective discovery
  • 204.
  • 205.
  • 206.
  • 207.
  • 208.
  • 209.
    Future WorkGenerate moredatasets from other domains, e.g. universities in Spain.Identify more links to DBPedia and Geonames.Cover complex geometrical information, i.e. not only Point and LineString-like data; we will also treat information representation through polygons.
  • 210.
    ContentsIntroductiontoLinked DataLinked DataFoundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption172
  • 211.
    Ontology-based Access toDBs1324Build a new ontology from 1 DB schema and 1 DBAlign the ontology built with approach 1 with a legacy ontologyAlign an existing DB with a legacy ontology a) Massive dump (semantic data warehouse) b) Query-drivenAlign an ontology network with n DB schemas and other data sources a) Massive dump (semantic data warehouse) b) Query-drivennew ontologyexisting ontology
  • 212.
    Ontology-based Access toDatabasesUniversidadProfesorDoctorandoOntología?OrganizaciónPersonalBDRModeloRelacionalPregunta: Nombre de los profesores de la universidad UPM* Un profesor es una persona cuyo puesto es “docente”* Una universidad es una organización de tipo “3”ProcesadorProcesado de la consulta de acuerdo a la descripción formal de correspondenciaConsulta: valores de la columna nombre de los registros de la tabla Personal para los que el valor de la columna puesto is “docente” que estén relacionados con al menos un registro de la tabla Organización con el valor “3” en la columna tipo y “UPM” en la columna nombre.
  • 213.
    Align data sourceswithlegacyontologiesAeropuertosOntologíaO2Ontología O1CentroComunicacionesPuntoGPSEstaciónPunto EuropeoAeropuertoPuntoAsiaticoPuntoEspañolAeropuertof (Aeropuertos)=PuntoEuropeof (Aeropuertos)=RC(O2,M1)RC(O1,M1)Modelo Relacional M1
  • 214.
    R2O is a declarative language to specify mappings between relational data sources and ontologies.<xml>R2O Mapping</xml>OrganizationPersonsUniversityRDBProfessorStudentRelational ModelOntology
  • 215.
    Example: types ofmappingsneededAttibute Mapping with transformation(Regular Expression)Attibute Direct MappingRelation Mapping w. Transformation(Regular Expression)Relation Mapping w. Transformation(Keyword search)
  • 216.
    Population example (II)Populationexample (II)The Operation element defines a transformation based on a regular expression to be applied to the database column for extracting property values
  • 217.
    For concepts...One ormore concepts can be extracted from a single data field (not in 1NF).A view maps exactly one concept in the ontology.For attributes...A column in a database view maps directly an attribute or a relation.A subset of the columns in the view map a concept in the ontology.A subset (selection) of the records of a database view map a concept in the ontology.A column in a database view maps an attribute or a relation after some transformation.A subset of the records of a database view map a concept in the onto. but the selection cannot be made using SQL.A set of columns in a database view map an attribute or a relation.R2O (Relational-to-Ontology) Language
  • 218.
    R2O Basic Syntax<conceptmap-defname="Customer"> <identified-by> Table key </identified-by> <uri-as>operation</uri-as> <applies-if>condition</applies-if> <joins-via> expression </joins-via> <documentation>description …</documentation> <described-by>attributes,relations</described-by></conceptmap-def><attributemap-defname="http://esperonto/ff#Title"> <aftertransform> <operationoper-id="constant"> <arg-restrictionon-param="const-val"> <has-column>fsb_ajut.titol</has-column> </arg-restriction> </operation> </aftertransform></attributemap-def><relationmap-defname="http://esperonto/ff#isCandidateFor"> <to-concept name="http://esperonto/ff#FundOpp"> <joins-via> <operationoper-id=“equals"> <arg-restrictionon-param="value1"> <has-column>fsb_ajut.id</has-column> </arg-restriction> <arg-restriction on-param="value2"> <has-column>fsb_candidate.forFund</has-column> </arg-restriction> </operation> </joins-via></relationmap-def>
  • 219.
    ODEMapster generates RDF instances from relational instances based on the mapping description expressed in the R2O document
  • 220.
  • 221.
  • 222.
  • 223.
  • 224.
  • 225.
    Online mode (runtime query execution)
  • 226.
    Offline mode (materializedRDF dump)ContentsIntroductiontoLinked DataLinked Data Foundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption183
  • 227.
    Using an RDFrepositoryItallowsstoring and accessing RDF dataForexample, SESAME (http://www.openrdf.org/)Downloaditfromhttp://www.openrdf.org/download.jspopenrdf-sesame-2.3.0-sdk.zipDeploythe .war in Tomcat (JDK and Tomcatneeded)Create a repository athttp://localhost:8080/openrdf-sesameCheck: http://localhost:8080/openrdf-sesame/repositories/XXXXhttp://localhost:8080/openrdf-sesame/repositories/XXX/statements
  • 228.
    Linked Data frontendToexposedata as Linked DataIncludingcontentnegotiation, etc.Forexample, Pubbyhttp://www4.wiwiss.fu-berlin.de/pubby/InstallationUse pubby-0.3.zipDeploythewebapp folder (and rename)in TomcatModify config.n3RestarttomcatCheck: http://localhost:8080/XXX/
  • 229.
  • 230.
    Java abstractionover RDFrepositorieshttp://rdf2go.semweb4j.org/
  • 231.
    Add SPARQL explorerForexample,SNORQL (http://wiki.github.com/kurtjx/SNORQL/)
  • 232.
  • 233.
    ContentsIntroductiontoLinked DataLinked DataFoundations: RDF, RDF Schema, SPARQL and OWLCoffee breakLinked Data publicationMethodologicalguidelinesforLinked Data publicationRDB2RDF toolsTechnicalaspects of Linked Data publicationLinked Data consumption189
  • 234.
    RelFinder: finding relationsin Linked DataE.g., relations between films“Pulp Fiction”, “Kill Bill” y “Reservoir Dogs”
  • 235.
    Exerciseon data.gov.ukPublicschools inLondon thatcontaintheword “music”Exercise: find information in DBPediaImage by http://www.flickr.com/photos/bflv/http://dbpedia.org/resource/Darth_Vader)Findficticious serial killers in DBPedia(etc)
  • 236.
    Designing URI setsforthePublic Sector (UK)http://www.cabinetoffice.gov.uk/media/301253/puiblic_sector_uri.pdf193
  • 237.
  • 238.
    Mini-curso sobre LinkedDataOscarCorcho, Asunción Gómez Pérez ({ocorcho, asun}@fi.upm.es)Universidad Politécnica de MadridFlorianópolis, September 1st 2010(3º OntoBras 2010)Credits: Raúl García Castro, Oscar Muñoz, Jose Angel Ramos Gargantilla, María del Carmen Suárez de Figueroa, Boris Villazón, Alex de León, Víctor Saquicela, Luis Vilches, Miguel Angel García, Manuel Salvadores, Juan Sequeda, Carlos Ruiz Moreno and manyothersWorkdistributedunderthelicenseCreativeCommonsAttribution-Noncommercial-Share Alike 3.0

Editor's Notes

  • #151 727 veces el term-based record-basedthesaurus