830 likes | 995 Views
Foundations III: Languages, Tools and Services. Deborah McGuinness Semantic eScience Fall 2011 Week 5, Oct. 3, 2011. Review of reading Assignment. 2. Ontology Tool Summary, Pellet, OWL-S, SAWSDL, Wine Agent Assignment 2 clarifications? Any comments, questions?. Contents.
E N D
Foundations III: Languages, Tools and Services Deborah McGuinness Semantic eScience Fall 2011 Week 5, Oct. 3, 2011
Review of reading Assignment 2 Ontology Tool Summary, Pellet, OWL-S, SAWSDL, Wine Agent Assignment 2 clarifications? Any comments, questions?
Contents • Review of reading, comments, questions? • Languages • Tools • Services • Summary and assignments
Semantic Web Methodology and Technology Development Process Establish and improve a well-defined methodology vision for Semantic Technology based application development Leverage controlled vocabularies, et c. Adopt Technology Approach Leverage Technology Infrastructure Science/Expert Review & Iteration Rapid Prototype Open World: Evolve, Iterate, Redesign, Redeploy Use Tools Analysis Use Case Develop model/ ontology Small Team, mixed skills 4
Semantic Web Layers 5 http://www.w3.org/2003/Talks/1023-iswc-tbl/slide26-0.html, http://flickr.com/photos/pshab/291147522/
Languages • RDFS – Resource Description Framework Schema • OWL – Web Ontology Language OWL • SKOS – Simple Knowledge Organization System • RIF – Rule Interchange Framework • SPARQL- SPARQL Protocol and RDF Query Language • OWL-S – OWL for Services
RDFS • Note: While XMLS was aimed at schemas, it has little expressive power if it is to be an ontology language • Changes format of DTDs (document schemas) to be XML • Adds an extensible type hierarchy • Integers, Strings, etc. • Can define sub-types, e.g., positive integers • RDFS is recognizable as an ontology language • Classes and properties • Sub/super-classes (and properties) • Range and domain (of properties)
However • RDFS too weak to describe resources in sufficient detail for many applications • No localized range and domain constraints • Can’t say that the range of hasChild is person when applied to persons and elephant when applied to elephants • No existence/cardinality constraints • Can’t say that all instances of person have a mother that is also a person, or that persons have exactly 2 parents • No transitive, inverse or symmetrical properties • Can’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetrical • … • Difficult to provide reasoning support • No “native” reasoners for non-standard semantics • May be possible to reason via First Order axiomatisation
OWL requirements Desirable features identified for Web Ontology Language: • Extends existing Web standards • Such as XML, RDF, RDFS • Easy to understand and use • Should be based on familiar KR idioms • Formally specified • Of “adequate” expressive power • Possible to provide automated reasoning support
The Original OWL language: • Original three species of OWL • OWL full is union of OWL syntax and RDF • OWL DL restricted to FOL fragment (¼ DAML+OIL) • OWL Lite is “easier to implement” subset of OWL DL • OWL DL based on SHIQDescription Logic • In fact it is equivalent to SHOIN(Dn) DL • OWL DL Benefits from many years of Description Logic research • Well defined semantics • Formal properties well understood (complexity, decidability) • Known reasoning algorithms • Implemented systems (highly optimized)
OWL Layering See http://www.w3.org/TR/owl-features/ section 2 for features and relation to RDF or OWL species
OWL 2 http://www.w3.org/2007/OWL/wiki/OWL_Working_Group Recommendation as of Oct. 27, 2009
W3C OWL 2 User Documents Document Overview - The place to start – light introduction to OWL 2 and its relationship to OWL http://www.w3.org/TR/owl2-overview/ New Features and Rationale - More details of the new features in OWL 2 along with their motivations http://www.w3.org/TR/owl2-new-features/ Primer - An introduction to OWL using a running example http://www.w3.org/TR/owl2-primer/ Quick Reference A brief synopsis of the features of OWL along with links into relevant documents (both to user and specification documents) http://www.w3.org/TR/owl2-quick-reference/ Next generation of the OWL 1 Guide - Next generation of a portion of the OWL 1 Overview combined with UMBC’s quick reference card Meetings: ISWC, OWLED, ESWC, Web Science, DL, Protégé, … 15
Why Some Users May Care about OWL 2 Datatype support: Many applications need more datatype support including things such as numerical comparisons (e.g., VSTO, SWEET, etc.) Selected additional expressive power: Different applications may need or benefit from features such as qualified cardinality. More support for annotations (e.g., for more support for knowledge provenance ) Definition and support for profiles McGuinness – SemTech June 16, 2009 16
OWL 2 Extends OWL with a small set of features That are motivated from application usage For which semantics and reasoning techniques are well understood That tool builders are willing and able to support Is fully backwards compatible with OWL: Every OWL ontology is a valid OWL 2 ontology Every OWL 2 ontology not using new features is a valid OWL ontology OWL Lite & OWL DL are both sublanguages of OWL 2, along with the new profiles (EL, QL, RL) Already supported by popular OWL tools & infrastructure: Protégé, Pellet, FaCT++, OWL API
New OWL 2 Features : Expressiveness qualified cardinality restrictions, e.g.: ObjectMinCardinality(2 friendOf hacker) property chains, e.g.: SubObjectPropertyOf(SubObjectPropertyChain(parent brother) uncle) local reflexivity restrictions, e.g.: ObjectExistsSelf(likes) [for narcissists] reflexive, irreflexive, symmetric, and antisymmetric properties, e.g.: ReflexiveObjectProperty(knows); IrreflexiveObjectProperty(husbandOf) flowsInto rdf:type owl:IrreflexiveProperty. Nothing can flow into itself. disjoint properties, e.g.: DisjointObjectProperties(childOf spouseOf) keys, e.g.: HasKey( US-Citizen () ( a:hasSSN ) )
New OWL2 features: MetaModelling Restricted form of metamodelling via “punning”, e.g. subClassOf(SnowLeopard BigCat) ClassAssertion(SnowLeopard EndangeredSpecies) http://www.w3.org/TR/owl2-new-features/#F12:_Punning Annotations of axioms as well as entities, e.g.: ClassAssertion(Comment(“source: WWF”) SnowLeopard EndangeredSpecies) Including annotations of annotations Punning allowed in OWL 2 but OWL 2 DL still imposes: Name cannot be used for both class and datatype Name can only be used for one type of property
Annotations •Annotation Assertion – Construct for annotation of ontology entities and anonymous individuals • Annotation – Construct for annotation of axioms and ontologies(even annotations themselves) • Annotations about annotation properties – SubAnnotationPropertyOf • Syntax example: :narrow_synonymrdfs:subPropertyOf:synonym. (UC#5) – The annotation property :narrow synonym is a subproperty of :synonym. – AnnotationPropertyDomain • Syntax example: FMA:UWDAIDrdfs:domainFMA:AnatomicalEntity. (UC#2) – Only FMA: AnatomicalEntitycan have an FMA:UWDAID (that is, an FMA ID) – AnnotationPropertyRange Syntax example: FMA:UWDAIDrdfs:rangexsd:positiveInteger.
New Features: Syntactic Sugar Disjoint unions Shorthand for combination of disjointWith and unionOf statements BrainHemisphereowl:disjointUnionOf( :LeftHemisphere:RightHemisphere) . BrainHemisphereis exclusively either a :LeftHemisphere or :RightHemisphere and cannot be both of them. DisjointUnion(Element Earth Wind Fire Water) Negative assertions States that a property does not hold for a particular individual NegativeObjectPropertyAssertion(Deborah hasChild Mary) NegativeDataPropertyAssertion (Peter hasAge 21)
Profiles OWL defines only one fragment (OWL Lite) OWL 2 defines three different fragments with useful computational properties EL: polynomial time reasoning for schema and data Useful for ontologies with large conceptual part QL: fast (logspace) query answering using RDBMs via SQL Useful for large datasets already stored in RDBs RL: fast (polynomial) query answering using rule-extended DBs Useful for large datasets stored as RDF triples
EL (Profiles Document Source) Supported class restrictions –existential quantification to a class expression (ObjectSomeValuesFrom) or a data range (DataSomeValuesFrom) –existential quantification to an individual (ObjectHasValue) or a literal (DataHasValue) –self-restriction (ObjectHasSelf) –enumerations involving a singleindividual (ObjectOneOf) or a singleliteral (DataOneOf) –intersection of classes (ObjectIntersectionOf) and data ranges (DataIntersectionOf) Supported axioms, restricted to class restrictions –class inclusion (SubClassOf) –class equivalence (EquivalentClasses) –class disjointness(DisjointClasses) –object property inclusion (SubObjectPropertyOf) with or without property chains, and data property inclusion (SubDataPropertyOf) –property equivalence (EquivalentObjectPropertiesand EquivalentDataProperties), –transitive object properties (TransitiveObjectProperty) –reflexive object properties (ReflexiveObjectProperty) –domain restrictions (ObjectPropertyDomainand DataPropertyDomain) –range restrictions (ObjectPropertyRangeand DataPropertyRange) –assertions (SameIndividual, DifferentIndividuals, ClassAssertion, ObjectPropertyAssertion, DataPropertyAssertion, NegativeObjectPropertyAssertion, and NegativeDataPropertyAssertion) –functional data properties (FunctionalDataProperty) –keys (HasKey)
EL does NOT support universal quantification to a class expression (ObjectAllValuesFrom) or a data range (DataAllValuesFrom) –cardinality restrictions (ObjectMaxCardinality, ObjectMinCardinality, ObjectExactCardinality, DataMaxCardinality, DataMinCardinality, and DataExactCardinality) –disjunction (ObjectUnionOf, DisjointUnion, and DataUnionOf) –class negation (ObjectComplementOf) –enumerations involving more than one individual (ObjectOneOfand DataOneOf) –disjoint properties (DisjointObjectPropertiesand DisjointDataProperties) –irreflexiveobject properties (IrreflexiveObjectProperty) –inverse object properties (InverseObjectProperties) –functional and inverse-functional object properties (FunctionalObjectPropertyand InverseFunctionalObjectProperty) –symmetric object properties (SymmetricObjectProperty) –asymmetric object properties (AsymmetricObjectProperty)
QL Supported class restrictions –Subclass Expressions a class existential quantification (ObjectSomeValuesFrom) where the class is limited to owl:Thing existential quantification to a data range (DataSomeValuesFrom) –SuperclassExpressions a class intersection (ObjectIntersectionOf) negation (ObjectComplementOf) existential quantification to a class (ObjectSomeValuesFrom) existential quantification to a data range (DataSomeValuesFrom) Supported axioms, compliant with class restriction expressions –subclass axioms (SubClassOf) –class expression equivalence (EquivalentClasses) –class expression disjointness(DisjointClasses) –inverse object properties (InverseObjectProperties) –property inclusion (SubObjectPropertyOfnot involving property chains and SubDataPropertyOf) –property equivalence (EquivalentObjectPropertiesand EquivalentDataProperties) –property domain (ObjectPropertyDomainand DataPropertyDomain) –property range (ObjectPropertyRangeand DataPropertyRange) –disjoint properties (DisjointObjectPropertiesand DisjointDataProperties) –symmetric properties (SymmetricObjectProperty) –reflexive properties (ReflexiveObjectProperty) –irreflexiveproperties (IrreflexiveObjectProperty) –asymmetric properties (AsymmetricObjectProperty) –assertions other than individual equality assertions and negative
QL does not support –existential quantification to a class expression or a data range (ObjectSomeValuesFromand DataSomeValuesFrom) in the subclass position –self-restriction (ObjectHasSelf) –existential quantification to an individual or a literal (ObjectHasValue, DataHasValue) –enumeration of individuals and literals (ObjectOneOf, DataOneOf) –universal quantification to a class expression or a data range (ObjectAllValuesFrom, DataAllValuesFrom) –cardinality restrictions (ObjectMaxCardinality, ObjectMinCardinality, ObjectExactCardinality, DataMaxCardinality, DataMinCardinality, DataExactCardinality) –disjunction (ObjectUnionOf, DisjointUnion, and DataUnionOf) –property inclusions (SubObjectPropertyOf) involving property chains –functional and inverse-functional properties (FunctionalObjectProperty, InverseFunctionalObjectProperty, and FunctionalDataProperty) –transitive properties (TransitiveObjectProperty) –keys (HasKey) –individual equality assertions and negative property assertions
RL –Subclass expressions •a class other than owl:Thing •an enumeration of individuals (ObjectOneOf) •intersection of class expressions (ObjectIntersectionOf) •union of class expressions (ObjectUnionOf) •existential quantification to a class expression (ObjectSomeValuesFrom) •existential quantification to a data range (DataSomeValuesFrom) •existential quantification to an individual (ObjectHasValue) •existential quantification to a literal (DataHasValue) –Superclassexpressions •a class other than owl:Thing •intersection of classes (ObjectIntersectionOf) •negation (ObjectComplementOf) •universal quantification to a class expression (ObjectAllValuesFrom) •existential quantification to an individual (ObjectHasValue) •at-most 0/1 cardinality restriction to a class expression (ObjectMaxCardinality0/1) •universal quantification to a data range (DataAllValuesFrom) •existential quantification to a literal (DataHasValue) •at-most 0/1 cardinality restriction to a data range (DataMaxCardinality0/1)
RL does not support OWL 2 RL supports all axioms of OWL 2 apart from disjoint unions of classes (DisjointUnion) and reflexive object property axioms (ReflexiveObjectProperty)
SKOS properties Simple Knowledge Organization System - W3C Recommendation Status on August 18, 2009 http://www.w3.org/2004/02/skos/ • skos:note e.g. ‘Anything goes.’ • skos:definition e.g. ‘A long curved fruit with a yellow skin and soft, sweet white flesh inside.’ • skos:example e.g. ‘A bunch of bananas.’ • skos:scopeNote e.g. ‘Historically members of a sheriff's retinue armed with pikes who escorted judges at assizes.’ • skos:historyNote e.g. ‘Deleted 1986. See now Detention, Institutionalization (Persons), or Hospitalization.’ • skos:editorialNote e.g. ‘Confer with Mr. X. re deletion.’ • skos:changeNote e.g. ‘Promoted “love” to preferred label, demoted “affection” to alternative label, Joe Bloggs, 2005-08-09.’
SKOS Vocabulary Elements • skos:mappingRelation • skos:closeMatch • skos:exactMatch • skos:broadMatch • skos:narrowMatch • skos:relatedMatch
SKOS Class and Property relations • S38 skos:mappingRelation, skos:closeMatch, skos:exactMatch, skos:broadMatch, skos:narrowMatch and skos:relatedMatch are each instances of owl:ObjectProperty. • S39 skos:mappingRelation is a sub-property of skos:semanticRelation. • S40 skos:closeMatch, skos:broadMatch, skos:narrowMatch and skos:relatedMatch are each sub-properties of skos:mappingRelation. • S41 skos:broadMatch is a sub-property of skos:broader, skos:narrowMatch is a sub-property of skos:narrower, and skos:relatedMatch is a sub-property of skos:related. • S42 skos:exactMatch is a sub-property of skos:closeMatch. • S43 skos:narrowMatch is owl:inverseOf the property skos:broadMatch. • S44 skos:relatedMatch, skos:closeMatch and skos:exactMatch are each instances of owl:SymmetricProperty. • S45 skos:exactMatch is an instance of owl:TransitiveProperty. • http://www.w3.org/2006/07/SWD/SKOS/reference/20081001/skos.txt
Integrity constraints • skos:exactMatch is disjoint with each of the properties skos:broadMatch and skos:relatedMatch.
SKOS example • <?xml version="1.0" encoding="UTF-8"?> • <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" • xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" • xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" • xmlns:skos="http://www.w3.org/2004/02/skos/core#"> • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#"> • <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/> • <dc:title>SKOS-based service taxonomy for DevX Article</dc:title> • <skos:hasTopConcept rdf:resource="http://zepheira.com/examples/soa-skos#Service"/> • </rdf:Description> • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#Service"> • <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> • <rdfs:comment>An rdfs:Class of services.</rdfs:comment> • </rdf:Description> • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#PrintingService"> • <rdf:type rdf:resource="http://zepheira.com/examples/soa-skos#Service"/> • <skos:narrower rdf:resource="http://zepheira.com/examples/soa-skos#LaserPrintingService"/> • <skos:narrower rdf:resource="http://zepheira.com/examples/soa-skos#PlotterPrintingService"/> • <skos:prefLabel>Printing Service</skos:prefLabel> • </rdf:Description>
SKOS example • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#LaserPrintingService"> • <rdf:type rdf:resource="http://zepheira.com/examples/soa-skos#Service"/> • <skos:narrower rdf:resource="http://zepheira.com/examples/soa-skos#ColorLaserPrintingService"/> • <skos:narrower rdf:resource="http://zepheira.com/examples/soa-skos#BWLaserPrintingService"/> • <skos:prefLabel>Laser Printing Service</skos:prefLabel> • </rdf:Description> • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#PlotterPrintingService"> • <rdf:type rdf:resource="http://zepheira.com/examples/soa-skos#Service"/> • <skos:prefLabel>Plotter Printing Service</skos:prefLabel> • </rdf:Description> • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#ColorLaserPrintingService"> • <rdf:type rdf:resource="http://zepheira.com/examples/soa-skos#Service"/> • <skos:prefLabel>Color Laser Printing Service</skos:prefLabel> • </rdf:Description> • <rdf:Description rdf:about="http://zepheira.com/examples/soa-skos#BWLaserPrintingService"> • <rdf:type rdf:resource="http://zepheira.com/examples/soa-skos#Service"/> • <skos:prefLabel>Black and White Laser Printing Service</skos:prefLabel> • </rdf:Description> • </rdf:RDF>
SKOS core and RDFS/OWL • Disjoint? • Should skos:Concept be disjoint with … • rdf:Property ? • rdfs:Class ? • owl:Class ? • http://www.w3.org/TR/2009/REC-skos-reference-20090818/#L1045 • http://skosapi.sourceforge.net/ • Editors • ThManager http://thmanager.sourceforge.net/ • SKOS API and Editor http://ftp.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-401/iswc2008pd_submission_88.pdf
Editors • Protégé (http://protege.stanford.edu) • SWOOP (http://mindswap.org/2004/SWOOP; see also http://www.mindswap.org/downloads/) • Altova SemanticWorks (http://www.altova.com/download/semanticworks/semantic_web_rdf_owl_editor.html) • SWeDE (http://owl-eclipse.projects.semwebcentral.org/InstallSwede.html), goes with Eclipse • NeON toolkit http://neon-toolkit.org/ • ThManager http://thmanager.sourceforge.net/ • TopBraid Composer and other commercial tools
CMAP CMAP Ontology Editor (COE) http://cmap.ihmc.us/
Protégé • http://protege.stanford.edu/ • http://protegewiki.stanford.edu/index.php/Protege-OWL • Please check version compatibility when choosing. • Do you have plugins you like? • (Prompt not compatible with version 4.0)
Query • Querying knowledge representations in OWL and/or RDF • OWL-QL (for OWL) http://projects.semwebcentral.org/projects/owl-ql/ • SPARQL for RDF http://www.sparql.org/ and http://www.w3.org/TR/rdf-sparql-query/ • W3C Recommendation as of January 15, 2008 • XQUERY (for XML) • SeRQL (for SeSAME) • RDFQuery (RDF) • Few as yet for natural language representations (ROO – Dolbear, et al., …)
What is Query? • http://esw.w3.org/SPARQL • Languages • SPARQL for RDF (http://www.sparql.org/ and http://www.w3.org/TR/rdf-sparql-query/ ) • RDFQuery for RDF • SeRQL for RDF (SeSAME) • OWL-QL for OWL (http://projects.semwebcentral.org/projects/owl-ql/ ) • XQUERY for XML • Few as yet for natural language representations (ROO – Dolbear, et al., …)
SPARQL • W3 Recommendation, Jan 2008 • SPARQL has 4 result forms: • SELECT – Return a table of results. • CONSTRUCT – Return an RDF graph, based on a template in the query. • DESCRIBE – Return an RDF graph, based on what the query processor is configured to return. • ASK – Ask a Boolean query. • The SELECT form directly returns a table • DESCRIBE and CONSTRUCT use the outcome of matching to build RDF graphs.
SPARQL Solution Modifiers • Pattern matching produces a set of solutions. This set can be modified in various ways: • Projection - keep only selected variables • OFFSET/LIMIT - chop the number solutions (best used with ORDER BY) • ORDER BY - sorted results • DISTINCT - yield only one row for one combination of variables and values. • The solution modifiers OFFSET/LIMIT and ORDER BY always apply to all result forms.
Query examples PREFIX foaf: <http://xmlns.com/foaf/spec/> SELECT ?url FROM <bloggers.rdf> WHERE { ?contributor foaf:name "Jon Foobar" . ?contributor foaf:weblog ?url . } namespace Returns a table in ‘url’ (can use $) Triple patterns using Turtle syntax
What happens • These triples together comprise a graph pattern. • The query attempts to match the triples of the graph pattern to the model. • Each matching binding of the graph pattern's variables to the model's nodes becomes a query solution, and the values of the variables named in the SELECT clause become part of the query results. • In this example, the first triple in the WHERE clause's graph pattern matches a node with a foaf:name property of "Jon Foobar," and binds it to the variable named contributor. • In the bloggers.rdf model, contributor will match the foaf:Agent blank-node at the top of the figure. • The graph pattern's second triple matches the object of the contributor's foaf:weblog property. • This is bound to the url variable, forming a query solution.
Using SPARQL with Jena • Jena calls RDF graphs "models" and triples "statements" because that is what they were called at the time the Jena API was first designed • ARQ's query engine can also parse queries expressed in RDQL or its own internal query language. ARQ is under active development, and is not yet part of the standard Jena distribution. • http://jena.sourceforge.net/ARQ/Tutorial/data.html • Can also use SPARQL from the command line
com.hp.hpl.jena.query package // Open the bloggers RDF graph from the filesystem InputStream in = new FileInputStream(new File("bloggers.rdf")); // Create an empty in-memory model and populate it from the graph Model model = ModelFactory.createMemModelMaker().createModel(); model.read(in,null); // null base URI, since model URIs are absolute in.close(); // Create a new query String queryString = "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + "SELECT ?url " + "WHERE {" + " ?contributor foaf:name \"Jon Foobar\" . " + " ?contributor foaf:weblog ?url . " + " }”; Query query = QueryFactory.create(queryString); // Execute the query and obtain results QueryExecution qe = QueryExecutionFactory.create(query, model); ResultSet results = qe.execSelect(); // Output query results ResultSetFormatter.out(System.out, results, query); // Important - free up resources used running the query qe.close();
More complex queries @prefix foaf: <http://xmlns.com/foaf/spec/> . _:a foaf:name "Jon Foobar" ; foaf:mbox <mailto:jon@foobar.xx> ; foaf:depiction <http://foobar.xx/2005/04/jon.jpg> . _:b foaf:name "A. N. O'Ther" ; foaf:mbox <mailto:a.n.other@example.net> ; foaf:depiction <http://example.net/photos/an-2005.jpg> . _:c foaf:name "Liz Somebody" ; foaf:mbox_sha1sum "3f01fa9929df769aff173f57dec2fe0c2290aeea" _:d foaf:name "M Benn" ; foaf:depiction <http://mbe.nn/pics/me.jpeg> .
Querying FOAF data with an optional block PREFIX foaf: <http://xmlns.com/foaf/spec> SELECT ?name ?depiction WHERE { ?person foaf:name ?name . OPTIONAL { ?person foaf:depiction ?depiction . } . } | name | depiction | | "A. N. O'Ther" | <http://example.net/photos/an-2005.jpg> | | "Jon Foobar" | <http://foobar.xx/2005/04/jon.jpg> | | "Liz Somebody" | | | "M Benn" | <http://mbe.nn/pics/me.jpeg>
Query with alternative matches, and its results PREFIX foaf: <http://xmlns.com/foaf/spec/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?name ?mbox WHERE { ?person foaf:name ?name . { { ?person foaf:mbox ?mbox } UNION { ?person foaf:mbox_sha1sum ?mbox } } } | name | mbox | | "Jon Foobar" | <mailto:jon@foobar.xx> | | "A. N. O'Ther" | <mailto:a.n.other@example.net> | | "Liz Somebody" | "3f01fa9929df769aff173f57dec2fe0c2290aeea" |