
The W3C HCLS interest group set out to use Semantic Web technologies to receive precise answers to a complex question:


<?xml version="1.0"?>
<ClinicalDocument transformation="hl7-rim-to-pomr.xslt">
<recordTarget>
<patientRole>
<patientPatient>
<name>
<given>Henry</given>
<family>Levin</family>
</name>
<administrativeGenderCode code="M"/>
<birthTime value="19320924"/>
</patientPatient>
</patientRole>
</recordTarget>
<component>
<StructuredBody>
<Observation>
<code displayName="Cuff blood pressure"/>
<effectiveTime value="200004071430"/>
<targetSiteCode displayName="Left arm"/>
<entryRelationship typeCode="COMP">
<Observation>
<effectiveTime value="200004071530"/>
<value value="132" unit="mm[Hg]"/>
</Observation>
</entryRelationship>
</Observation>
<Observation>
<code displayName="Cuff blood pressure"/>
<effectiveTime value="200004071530"/>
<targetSiteCode displayName="Left arm"/>
<entryRelationship typeCode="COMP">
<Observation>
<code displayName="Systolic BP"/>
<effectiveTime value="200004071530"/>
<value value="135" unit="mm[Hg]"/>
</Observation>
</entryRelationship>
<entryRelationship typeCode="COMP">
<Observation>
<code displayName="Diastolic BP"/>
<effectiveTime value="200004071530"/>
<value value="88" unit="mm[Hg]"/>
</Observation>
</entryRelationship>
</Observation>
</StructuredBody>
</component>
</ClinicalDocument>
_:p r:type galen:Patient .
_:p r:type galen:Patient ;
foaf:familyName "Levin" .
_:p r:type galen:Patient ;
foaf:familyName "Levin" ;
foaf:givenName "Henry" .
_:p r:type galen:Patient ;
foaf:familyName "Levin" ;
foaf:givenName "Henry" .
_:scr dc:date "2006-03-18T18:23"^^xsd:dateTime .
_:p r:type galen:Patient ;
foaf:familyName "Levin" ;
foaf:givenName "Henry" .
_:scr dc:date "2006-03-18T18:23"^^xsd:dateTime ;
edns:systolic "132"^^edns:mmHg .
_:p r:type galen:Patient ;
foaf:familyName "Levin" ;
foaf:givenName "Henry" .
_:c edns:patient _:p ;
edns:screeningBP _:scr .
_:scr dc:date "2006-03-18T18:23"^^xsd:dateTime ;
edns:systolic "132"^^edns:mmHg ;
edns:diastolic "86"^^edns:mmHg ;
edns:posture snomed:_163035008 .
<http://thefigtrees.net/lee/id#lee> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . <http://thefigtrees.net/lee/id#lee> <http://xmlns.com/foaf/0.1/name> "Lee Feigenbaum" . <http://thefigtrees.net/lee/id#lee> <http://xmlns.com/foaf/0.1/homepage> <http://thefigtrees.net/lee/> .
... is more succinctly represented as:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://thefigtrees.net/lee/id#lee> rdf:type foaf:Person ;
foaf:name "Lee Feigenbaum" ;
foaf:homepage <http://thefigtrees.net/lee/> .
_:p1 a galen:Patient ;
foaf:family_name "Levin" ;
foaf:firstName "Henry" .
_:c1a edns:patient _:p1 ;
edns:screeningBP [
a cpr:clinical-examination ;
dc:date "2000-04-07T15:30:00" ;
edns:systolic [
a galen:AbsoluteMeasurement ;
ex:unit "mm[Hg]" ;
r:value "132" ;
skos:prefLabel "Systolic BP"
] ;
edns:diastolic [
a galen:AbsoluteMeasurement ;
ex:unit "mm[Hg]" ;
r:value "86" ;
skos:prefLabel "Diastolic BP"
] ;
edns:location snomed:_66480008 ; # SNOMED:left arm
edns:posture snomed:_163035008 # SNOMED:sitting
] .
| There is a blood-pressure examination of a patient named Henry Levin. The examination was on 7-April-2000 at 3:30pm and was conducted on the patient's left arm while he was sitting. The examination resulted in a systolic blood pressure measurement of 132 and a diastolic measurement of 86. |
SPARQL is the query language of the Semantic Web. It lets us:
| ?artist | ?album | ?times_platinum |
|---|---|---|
| Michael Jackson | Thriller | 27 |
| Led Zeppelin | Led Zeppelin IV | 22 |
| Pink Floyd | The Wall | 22 |
A triple pattern is an RDF triple that can have variables in any of the subject, predicate, or object positions.
Examples:
We can combine more than one triple pattern to retrieve multiple values and easily traverse an RDF graph:
SPARQL lets us query different RDF graphs in a single query. Consider movie reviews:
GRAPH <http://example.org/reviews/rogerebert> {
ex:atonement rev:hasReview ?review .
?review rev:rating ?rating .
}
GRAPH <http://example.org/reviews/rogerebert> {
?movie rev:hasReview ?rev1 .
?rev1 rev:rating ?ebert .
}
GRAPH <http://example.org/reviews/me> {
?movie rev:hasReview ?rev2 .
?rev2 rev:rating ?me .
}
GRAPH ?reviewer_graph {
?review rev:rating 10 .
}
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX edns: <http://www.loa-cnr.it/ontologies/ExtendedDnS.owl#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX galen: <http://www.co-ode.org/ontologies/galen#>
PREFIX r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX snomed: <http://termhost.example/SNOMED/>
SELECT ?date ?sys ?dias ?position {
?p r:type galen:Patient ;
foaf:family_name "Levin" ;
foaf:firstName "Henry" .
?c edns:patient ?p ;
edns:screeningBP ?scr .
?scr dc:date ?date ;
edns:systolic [ r:value ?sys ] ;
edns:diastolic [ r:value ?dias ] ;
edns:posture ?position .
} ORDER by ?date
The sample query can be run against this sample data.
Or try sparql.org with this query against this data.
GRDDL (Gleaning Resource Descriptions from Dialects of Languages) is a way to boostrap RDF out of XML and in particular XHTML data by explicitly indicating transformations from RDF to XML. GRDDL relies on:
GRDDL can extract RDF from both XML and (X)HTML.
| Patient | Systolic BP | Diastolic BP |
|---|---|---|
| Henry Levin | 132 | 86 |
| ... | ... | ... |
<html> <head profile="http://www.w3.org/2003/g/data-view"> <title>Clinical Study 8B1a: Patient BP</title> <link rel="transformation" href="bp-html-to-pomr.xslt" /> </head> ...
Some SPARQL engines can directly query GRDDL source documents.
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX edns: <http://www.loa-cnr.it/ontologies/ExtendedDnS.owl#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX galen: <http://www.co-ode.org/ontologies/galen#>
PREFIX r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?date ?sys ?dias ?location ?position {
?p r:type galen:Patient ;
foaf:family_name "Levin" ;
foaf:firstName "Henry" .
?c edns:patient ?p ;
edns:screeningBP ?scr .
?scr dc:date ?date ;
edns:systolic [ r:value ?sys ] ;
edns:diastolic [ r:value ?dias ] ;
edns:location ?location ;
edns:posture ?position .
}
The actual query against the actual XML source is more complex. You can try it live against Virtuoso with this live query.

InChI is a textual identifier for chemical substances. Consider inchi.html:
<table> <tr> <th>Familiar name</th><th>InChI</th> </tr><tr> <td>Methane</td> <td about="http://example.org/methane" property="chem:inchi" xmlns:chem="http://www.blueobelisk.org/chemistryblogs/"> InChI=1S/CH4/h1H4 </td> ...
This RDFa encodes the single RDF triple:
<http://example.org/methane> chem:inchi "InChI=1S/CH4/h1H4" .
See inchi.html.
There are various ways to query Web pages marked up with RDFa:
# Find propane's InChI string
PREFIX chem: <http://www.blueobelisk.org/chemistryblogs/>
PREFIX ex: <http://example.org/>
SELECT ?inchi
FROM <http://www.w3.org/2007/08/pyRdfa/extract?uri=http://www.w3.org/2008/Talks/0305-C-SHALS/inchi.html>
WHERE {
ex:propane chem:inchi ?inchi .
}
You can try it against sparql.org.
[Named] collections of things with similar attributes.
[Named] collections of things with similar attributes.
[Named] collections of things with similar attributes.
| Allows you to define classes. |
intersection
complement
restriction
cardinality
equivalence
:Bob owl:sameAs :BobSmith .
foaf:mbox a owl:inverseFunctionalProperty . :Bob foaf:mbox <mailto:bobS@foo.example> . :BobSmith foaf:mbox <mailto:bobS@foo.example> . ⇒ :Bob owl:sameAs :BobSmith
:patient owl:maxCardinality 1 . :patientEncounter5 :patient :Bob . :patientEncounter5 :patient :BobSmith . ⇒ :Bob owl:sameAs :BobSmith
:DrJones :specialty :Cancer . ⇒ :DrJones rdf:type :Oncologist .
