cimi / fhir and shape expressions. local db … …

27
CIMI / FHIR and Shape Expressions

Upload: merryl-king

Post on 24-Dec-2015

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CIMI / FHIR and Shape Expressions. Local DB … …

CIMI / FHIR and Shape Expressions

Page 2: CIMI / FHIR and Shape Expressions. Local DB … …
Page 3: CIMI / FHIR and Shape Expressions. Local DB … …
Page 4: CIMI / FHIR and Shape Expressions. Local DB … …
Page 5: CIMI / FHIR and Shape Expressions. Local DB … …

Local DB

Local DB

Local DB …

Page 6: CIMI / FHIR and Shape Expressions. Local DB … …

Preferred Strategy – Full Interoperability

Local databases,CDA, HL7 V.2, etc.

Term andStructureTranslators

Application

Standard StructureAND Standard Terms

(As defined by CIMI Models)

Application and User

Requ

irem

ents

Page 7: CIMI / FHIR and Shape Expressions. Local DB … …

Addressing Instances

• Semantics– A combination of identifiers and structure– Have to determine whether two columns /

elements / attributes / classes / … reference the same thing

– (Potentially) have to split or join multiple elements to achieve the same level of granularity (e.g. by microparsing or exploiting contextual information)

– Have to recognize and make explicit tacit information (units / data referent / workflow state / …)

Page 8: CIMI / FHIR and Shape Expressions. Local DB … …

Addressing Instances

• Syntax– With the exception of granularity/compositional

issues, should be orthogonal to semantics– As such, it would be really handy to arrive at a

representational form (syntax) that:• Is readily transformed to and from multiple “native”

syntaxes• That has minimal restrictions on what can be said in the

syntax

Page 9: CIMI / FHIR and Shape Expressions. Local DB … …

Proposal

RDF is close to ideal for a “neutral” syntax– Triples provide minimal (absolute minimum?)

restrictions on semantic aspects– Semantic identifiers have single form (URI)– Links to ontologies and terminologies provide key

need for mapping– Tools exist today (any23, …) for mapping any

syntax to RDF and visa-versa.

Page 10: CIMI / FHIR and Shape Expressions. Local DB … …

What is Missing?

SchemaXML SchemaJava Class / Interface(… under construction …)DDLUMLOWL( ? )

InstanceXMLJava ObjectJSONSQL Tables(XMI -- …?)( --- not really a schema ---)RDF

Page 11: CIMI / FHIR and Shape Expressions. Local DB … …

RDF Data Shapes

• Define a schema for RDF• RDF – a set of triples. Constraints:– Subject must be IRI or Blank Node– Predicate must be a IRI– Object must be a IRI, a Blank Node or a Literal

• Any set of triples that meets the constraints above is valid– Even basic structures like lists, reification, etc. are

not constraints…

Page 12: CIMI / FHIR and Shape Expressions. Local DB … …

RDF Data Shapes

• Constraints on a set of triples:– Triples that MUST exist– Triples that MAY NOT exist– Triple references– Object values– …

• A Schema language for RDF

Page 13: CIMI / FHIR and Shape Expressions. Local DB … …

Data Shape Examplestart = <IssueShape> # Issue validation starts with <IssueShape>

<IssueShape> { # An <IssueShape> has: ex:state (ex:unassigned ex:assigned), # ex:state predicate with a target of either

# ex:unassigned or ex:assigned ex:reportedBy @<UserShape>, # ex:peportedBy predicate whose target matches

# <UserShape> ex:reportedOn xsd:dateTime, # ex:reportedOn predicate whose object is

# a valid xsd:dateTime ( # optionally ex:reproducedBy @<EmployeeShape>, # a ex:reproducedBy predicate w/

# Target URI that references vaid UserShape ex:reproducedOn xsd:dateTime # and a ex:reproducedOn predicate w/ date time )?, ex:related @<IssueShape>* # 0 or more ex:related predicates whose objects

# are the subject of a valid issue shape}<UserShape { …}

Page 14: CIMI / FHIR and Shape Expressions. Local DB … …

RDF Data Shapes

• Previous example is in a specific grammar (ShEx)– W3C is working on other representational forms

under “SHACL” rubric• RDF Data Shapes do not specify semantics (!!)

Page 15: CIMI / FHIR and Shape Expressions. Local DB … …

This is a valid “Issue” shape …

<Issue1> ex:state ex:unassigned ; ex:reportedBy <User2> ; ex:reportedOn "2013-01-23T10:18:00"^^xsd:dateTime.<User2> foaf:name "Bob" ; foaf:mbox <mailto:[email protected]>.

Page 16: CIMI / FHIR and Shape Expressions. Local DB … …

… but so is this

foaf:firstName ex:state ex:unassigned ; ex:reportedBy ex:cornflakes; ex:reportedOn "2013-01-23T10:18:00"^^xsd:dateTime.ex:cornflakes foaf:name ”Kellog’s Corn Flakes" ; foaf:mbox <mailto:[email protected]>.

Page 17: CIMI / FHIR and Shape Expressions. Local DB … …

Why RDF Data Shapes?

• Tools exist (or soon will) to transform XML Schema, UML Models, FHIR models, CIMI models, SQL DDL, … into ShEx– XML Schema ShEx– XML RDF– … RDF can be validated / queried using ShEx

Page 18: CIMI / FHIR and Shape Expressions. Local DB … …

Why ShEx?

• ShEx is based on parser semantics– Essentially a grammar with a fixed RDF Lexer– ShEx includes the notion of “semantic annotations” (!!!)

• ShEx can be used as:– A validation tool … “Are these triples a valid instance of

X”– A query tool … “Find all subjects whose triples are valid

instances of X”– A transformation tool (!) … “Every time you see a valid

instance of X, emit the triple “(subj) rdf:type ex: X”

Page 19: CIMI / FHIR and Shape Expressions. Local DB … …

ShEx as a transformation tool

• Shape expression serves the role of a digital “ribosome”, crawling sets of related triples– Can be used to copy and modify RDF– Can emit other languages (XML, TSV, …)– Can generate code– Can create forms– …

Page 20: CIMI / FHIR and Shape Expressions. Local DB … …

Transformation Model

Source Schema

Source SchemaIn ShEx

Target Schema

Target SchemaIn Shex

Source InstanceSource Instance

Any23 transform

RDF

“Native”

CommonModel

Page 21: CIMI / FHIR and Shape Expressions. Local DB … …

ShEx Example

http://shexspec.github.io/extensions/Map/

Page 22: CIMI / FHIR and Shape Expressions. Local DB … …

DNA Translation

Page 23: CIMI / FHIR and Shape Expressions. Local DB … …

Data Translation

Any23 transform

Visitor / Listeners

ShEx Process

Data Synthesis

GeneratedData/Code

RDF Triples

Page 24: CIMI / FHIR and Shape Expressions. Local DB … …

Current Projects

• FHIR RDF• FHIR Schema ShEx• UML ShEx • AML / ADL ShEx

Page 25: CIMI / FHIR and Shape Expressions. Local DB … …

ShEx Processors

• JavaScript Implementation – JISON

• Haskell Implementation• Scala Implemention• Python Implementation– (ANTLR)

Page 26: CIMI / FHIR and Shape Expressions. Local DB … …

Additional Work

• W3C SHACL Group– RDF Representation– ShEx compatible (?)– Currently spearheaded by Holger Knoblauch

(TopQuadrant) w/ SPIN focus• ShEx Group– Face to Face in Lille August 17-21

Page 27: CIMI / FHIR and Shape Expressions. Local DB … …

Links• any23: “Anything to triples” https://any23.apache.org/

• http://www.w3.org/2013/ShEx/FancyShExDemo — demo (not examples bar hidden on LHS)

• http://www.w3.org/2005/01/yacker/uploads/ShEx3/bnf?lang=perl — BNF for ShEx

• https://github.com/shexSpec/grammar/blob/master/shExDoc.g4 — ANTLR for ShEx

• https://www.w3.org/2014/data-shapes/wiki/Main_Page — SHACL working group

• http://www.w3.org/2013/ShEx/Primer — intro

• https://github.com/shexSpec — general repository