From W3C Wiki
Jump to: navigation, search
# Template for N3 document

# Allows use of unprefixed names instead of :name style names
@keywords a, has, is, of, this.
@prefix : <#>.
@prefix rdf: <> .
@prefix rdfs: <>.
@prefix skos: <>.
@prefix owl: <>.
@prefix xsd: <>.
@prefix dc: <http://>.
@prefix foaf: <>.
@prefix vcard: <>.
# Identify the document
# =====================================================================
# Patient: Mary Kay SMITH -- History #AB98765
# 1/1/2009
# CLINICAL: 611.72 Lump Or Mass In Breast-611.72 Patient with palpable
# abnormality in left breast. Post left lumpectomy. Recent MRI
# demonstrated suspicious lesions in left breast.
# ---------------------------------------------------------------------
<> = this.
# to make this more English-like, I give the document a name; "theDocument"
this interprets dc:identifier "12345678"; has permanentURL <>; is a MammogramReport; has foaf:topic thePatient].
# some basic information about theDocument: 
# - it has an identifier (this could be the hospital report number); 
# - it has (ideally) a permanent url; 
# - the genre of the report is a mammogram report; 
# - its topic is thePatient (see below).
thePatient is a Patient; is skos:example PatientConcept; has foaf:familyName "Smith"; has foaf:givenName "Mary Kay"; has medicalRecordNumber "AB98765".
theRadiologist = [a Radiologist; dc:author theDocument; foaf:name "Fred Flintstone"].
# some basic information about thePatient: 
# - she is a patient (member of some rdf class "Patient", about which possibly more later);
# - if we can't find an appropriate rdf/owl class, we at least can say that she is a skos:example of a skos:Concept "PatientConcept" -- we should be able to find that in some (not necessarilly rdf/owl) terminology someplace!!
# - we use foaf for some basic information about her name; we probably need a more rigorous demographic vocabulary for this sort of document
# - we specify her medical record number, and certainly we need a good vocabulary for this
theDocument has dc:title "BILATERAL DIGITAL DIAGNOSTIC MAMMOGRAM POST LUMPECTOMY MAMMOGRAM"; has dc:date "2009-01-01"^^dc:W3CDTF; has dc:subject theProcedure.
theProcedure is a Procedure; is a DigitalMammogram; has target thePatient; has laterality bilateral.
# how to model Clinical History is very dependent 
# on whether you wish to model this as Facts or as (maybe even defeasible)
# assertions.

# Here's the way I proposed it in the CSHALS presentation:

<> = theSource.

theRadiologist foaf:name "Kenneth Kirk".

<> = this.

theSource is a foaf:Document;
 has dc:identifier "12345679";
 has dc:date "2009-01-01"^^xsd:date;
 dc:author theRadiologist;  has dc:author [foaf:name "Jenny Jones"]; has dc:publisher [foaf:name "Acme Hospital"].

this is a void:Dataset;
 has dc:source theSource;
 has dc:creator [foaf:name "John Madden"];
 dc:issued "2010-12-31"^^xsd:date.

this interprets theSource.
theSource has grddl:result this.

# end CSHALS

# here is one way to do it:
thePatient has theClinicalHistory.
theClinicalHistory is a ClinicalHistory; = (theFinding-1, theFinding-2, theFinding-3).
theFinding-1 has dc:label "LUMP OR MASS IN BREAST"; = {thePatient has finding [a breastLump]}.
theFinding-2 has dc:label "palpable abnormality in left breast"; = {thePatient has finding [a Abnormality; locatedIn [a Breast; laterality left; inBody of thePatient]]}.
theFinding-3 has dc:label "Post left lumpectomy"; = {thePatient has finding [a CompletedLumpectomy; laterality left]}.
theFinding-4 has dc:label "Recent MRI demonstrated suspicious lesion in left breast"; = {thePatient has finding [a MRI; has result theMRIResult]}.
theMRIResult = {thePatient has finding [a Lesion; inBody of thePatient; has significance suspicious]}.
# the Description is best modeled using an "on-the-fly" vocabulary
aPriorMammomgram = [a MammogramReport; dated "2008-01-01"^^xsd:date; ].
aPriorBiopsy = [a UltrasoundBiopsyReport; dated "2007-01-01"^^xsd:date].
theDocument has part [= theDiagnosis; a Diagnosis; dc:author theRadiologist].
theRadiologist performs [a Comparison; between theDiagnosis, aPriorMammogram, aPriorBiopsy].
# or, theComparison is among (theDiagnosis, aPriorMammogram, aPriorBiopsy).
thePatient has [a RightBreast; = theRightBreast], [a LeftBreast; = theLeftBreast].
bothBreasts = (theRightBreast, theLeftBreast).
# Now it gets really interesting
# do I model this as a finding, or as a fact?
# also, how many findings are there in the report? 1, 2, many?
# here I've modeled it as a single finding, which is shared by both breasts
theRightBreast has finding someFibroglandularElements.
theLeftBreast has finding someFibroglandularElements.
someFibroglandularElements = [a Finding; a [a owl:Restriction; owl:onProperty refersTo; owl:minCardinality 2]].
# this is an interesting statement, in that it uses a
someFibroglandularElements has qualifier scattered.
# or if you want to get fancy, you could say, "the finding is of >1 fibroglandular element", something like this:

# here's more from the CSHALS:

#  it's hard to imagine a medical document so elementary

## that it wouldn't reference at least 

## two (2) non-identical entities!

theMassAt9 is a Mass.

theMassAt1 is a Mass.

theMassAt9 owl:differentFrom	theMassAt1.

theSpecimen contains theMassAt9, theMassAt1.

# or, saving a line
theSpecimen contains [a Mass; = theMassAt9].

# theSpecimen contains [a Mass; = theMassAt1].
theMassAt9 owl:differentFrom	theMassAt1.

# in fact, you might want to collect all instances

# that you define and declare an owl:AllDifferent class

# [a owl:AllDifferent]	 owl:distinctMembers
 (theRadiologist, thePatient, 
 theMassAt9, theMassAt1… ).

this has foaf:topic thePatient.
thePatient is a Patient.
Patient is a skos:Concept.
# later add whatever mapping axioms you want

# (we favor using SKOS whenever possible)...
Patient has skos:broader foaf:Person;
 has skos:closeMatch snomed:378243823, radlex:347439845,

# or even add more forceful axioms

# (but beware of "ontological overcommitment")...
Patient is rdfs:subClassOf dc:Agent;
 has owl:equivalentClass gom:Patient.

# these are pretty commonplace assertion types

# hard to imagine much structural variation here

# can pick a specific vocabulary later

theMassAt9 size [dimension [val "1.2"^^xsd:float; unit cm], [val "1.3"^^xsd:float; unit cm]].

# more sketchy, depends on chosen anatomy vocabulary

theMassAt9 location [a Location; in thePatient,
 [a Breast; laterality left],
 [rdfs:label "9:00"]].

# very sketchy

# these are modeled loosey-goosey as value partitions

# need no idea how e.g. Radlex might do this

theMassAt9 shape round.

theMassAt9 margin indistinct.

theMassAt9 echogenicity isoechoic.

# I (radiologist) am suspicious for malignancy.
theRadiologist suspects [a Malignancy].

# This mammogram is suspicious for malignancy.
{theMammogram shows [a Malignancy]} urw:hasUncertainty  highProbability.

# The findings are suspicious for malignancy.
theLesion hasFeature X, Y.
{theLesion hasFeature X, Y} suggests {thePatient has [a Malignancy]}. 

# The mass is suspicious for malignancy.
theMass hasAppearance malignantAppearance.

# The patient's category is Suspicious for Malignancy.
thePatient diagnosticCategory SuspiciousForMalignancy.

# The diagnosis is: "Suspicious for Malignancy".
theDiagnosis = "Suspicious for Malignancy".

# The diagnosis category is Suspicious for Malignancy.
theDiagnosis has diagnosticCategory SuspiciousForMalignancy.

# The report category is Suspicious for Malignancy.
this has diagnosticCategory SuspiciousForMalignancy.

# This patient should be managed according to the

# applicable Suspicious for Malignancy protocol.
# ???????

# end more from the CSHALS

# =====================================================================
# INTERNAL AXIOMS: Some assertions regarding the document-only resources in
# this interpretation
Patient is rdf:subClassOf foaf:Person.
Patient is a skos:Concept;
 has skos:label of "patient".
MammogramReport is a foaf:Document.

# =====================================================================
# BACKGROUND AXIOMS: Some assertions regarding the background knowledge
# assumed by the interpreter (i.e. me, not the author)