W3C logo
slanted W3C logo

RDF-Related Tech at W3C

W3C Semantic Web in Health Care and Life Sciences.


Eric Prud'hommeaux, Sanitation Engineer. Last modified: $Date: 2009/11/02 22:53:04 $
Creative Commons License This work is licensed under a Creative Commons Attribution 3.0 License, with attribution to W3C.

Valid XHTML + RDFa

Index

New SPARQL Query Features

MUST:

MAY (read "MIGHT"):

SPARQL Graph Patterns

SELECT ?patient ?dob
WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   …
              ?substAdmin  sdtm:subject ?patient;  sdtm:medName ?takes  …
 NOT EXISTS { ?contraAdmin sdtm:subject ?patient;  sdtm:medName ?contra … }
}

SPARQL Aggregates

SELECT ?patient ?dob SUM(?substAdmin) AS ?total
WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   …
              ?substAdmin  sdtm:subject ?patient;  sdtm:medName "Illudium Phosdex"  …
} GROUP BY ?patient

SPARQL Subqueries

SELECT ?patient ?dob
WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   …
              ?substAdmin  sdtm:subject ?patient;  sdtm:medName ?takes  …
  SELECT ?patient
  WHERE {
              ?contraAdmin sdtm:subject ?patient;  sdtm:medName ?contra …
  } ORDER BY ?contra LIMIT 1
}

SPARQL Project Expressions

SELECT ?patient ?dob ?contraURL
WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   …
              ?substAdmin  sdtm:subject ?patient;  sdtm:medName ?takes  …
  SELECT ?patient fn:concat('http://dbpedia.org/', ?contra) AS ?contraURL
  WHERE {
              ?contraAdmin sdtm:subject ?patient;  sdtm:medName ?contra …
  } ORDER BY ?contra LIMIT 1
}

SPARQL Property Paths

SELECT ?patient ?dob
WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   …
              ?substAdmin  sdtm:subject ?patient;  sdtm:ingredient* [ spl:classCode ?code ] .
}

SPARQL Query Federation

SELECT ?patient ?dob
WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   .
              ?substAdmin  sdtm:subject ?patient;  sdtm:medName ?takes  .
    SERVICE <http://drugsЯus.com/> {
	      ?takes       stdm:ingredent [ spl:classCode 6809 ] .

    }
}

Other New SPARQL Features

MUST:

SPARQL Update

INSERT {
    GRAPH <http://drugsЯus.com/mmkay> {
              ?substAdmin  sdtm:medName "Illudium Phosdex" .
    }
} WHERE {
              ?patient     sdtm:sex     ?sex;      sdtm:dob     ?dob;   .
              ?substAdmin  sdtm:subject ?patient .
    SERVICE <http://drugsЯus.com/mmkay> {
	      ?takes       stdm:ingredent [ spl:classCode 6809 ] .
    }
}

Service Description

<http://drugsЯus.com/> a sd:Service ;
		       sd:language foo:Sparql10_plus_federation ;
		       sd:entailment foo:RDFS ;
		       sd:function fn:concat .

D2R Service Description

<> a d2r:Server;
    rdfs:label "D2R Server";
    d2r:baseURI <http://localhost:2020/>;
    d2r:port 2020;
    d2r:documentMetadata [
        rdfs:comment "This comment is custom document metadata.";
    ];
	d2r:vocabularyIncludeInstances true;    
    .

Graph Management Protocol


                      DROP SILENT GRAPH <request_uri>
PUT <request_uri>  =  CREATE SILENT GRAPH <request_uri>
  … RDF payload …     INSERT DATA { GRAPH <request_uri> { … RDF payload … } }

SPARQL Entailment Regimes

Two models:

Paul rdf:type Worker .        
Paul :hasFriend Andrea .      
Andrea rdf:type Employee .    
Andrea :hasFriend Caroline .  
Caroline rdf:type Manager .
Paul rdf:type Worker .	 
Paul :hasFriend Simon .	 
Simon rdf:type Employee .
Simon :hasFriend Andrea .
Andrea rdf:type Manager .

Query:

  Paul :hasFriend _:Y .
  _:Y rdf:type Employee .
  _:Y hasFriend _:Z .
  _:Z rdf:type Manager .

Inference

Rules

Rules Interchange Format (RIF)

Modeling Languages

Inferring types

Inferring types

OWL - inferring lots of stuff

Introduction to OWL

(skip to new OWL)

OWL consistency rules

OWL type inference

OWL identity inference

OWL expression

OWL restrictions

OWL restrictions

OWL restrictions

OWL 1.1

Syntactic Suger

Expressivity Extensions

Annotation Properties

Describe individuals; produce no inferences.

Punning

Permit my:Patient to stand for a class or datatype AND an concept.

This coincident naming produces no inference.

OWL 1.1 Language Profiles

subsetexpressivity
ELpopular restrictive subsetSNOMED-CT, NCI Thesaurus
QLSQLEntity-relationship, UML
RL@@production@@ rules

POWDER

<dr>
  <iriset>
    <includehosts>drugsЯus.com</includehosts>
    <includepathstartswith>/antidiabetic/metformin</includepathstartswith>
  </iriset>

  <descriptorset>
    <ex:code>6809</ex:code>
 </descriptorset>
</dr>

RDF Channeling Existing Data

XML data

<?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>

Mapped to RDF

[unrendered SVG image of HL7 data in RDF]

Relational data …

[unrendered SVG image of HL7 data in a relational database]

… as a graph.

[unrendered SVG image of HL7 data in RDF]

Relational Mappings

D2R

<d2r:ClassMap
   d2r:type="eb:Customer"
   d2r:sql="SELECT Tab_K_Kunde.KundenNr, Tab_K_Kunde.FullName,
        Tab_K_Kunde.Anrede, Tab_K_Kunde_Kreditkarte.CCNo
        FROM Tab_K_Kunde_Kreditkarte INNER JOIN Tab_K_Kunde ON
        Tab_K_Kunde_Kreditkarte.KundenNr = Tab_K_Kunde.KundenNr;"
   d2r:groupBy="Tab_K_Kunde.KundenNr"
   d2r:uriPattern=
       “http://example.org/customers#@@Tab_K_Kunde.KundenNr@@“>

Re-uses OWL constructs:

<d2r:ObjectPropertyBridge d2r:property="rdf:type"
   d2r:pattern="iswc:@@Persons.Position@@"/>

Configuration consumable as RDF (SPARQL-able).

Relational Views (DDL)

create iri class prd:product_iri using
  function OPLWEB.DBA.PRODUCT_URI (in id varchar)
    returns varchar,
  function OPLWEB.DBA.PRODUCT_URI_INVERSE (in id_iri varchar)
    returns varchar .

Uses hardened algorithms from SQL land.

RDF Views

   PREFIX :mydb <http://cityhospital.example/dbs>
CONSTRUCT { ?o a               study:SubjectObservation .
            ?o study:subject   ?p .
            ?o study:clinician ?d .
            ?d :foaf:name ?dName }

    WHERE { ?o mydb:patient ?p .
            ?o mydb:doctor  ?d .
            ?d mydb:name    ?dName }

Intuitive (testable) semantics.

Inputs