Meta model class specification

From Endeavour Knowledge Base
Revision as of 09:59, 6 July 2023 by DavidStables (talk | contribs)

The information model's meta model is a small set of relatively simple classes capable of holding huge sophisticated ontologies, an extensible data model, as well as set and query definitions.

The main classes are illustrated here on the right, and the class definitions and subclasses are specified in text, the tables and text being auto generated from the IM SHACL shapes.

Basic shapes

These shapes are the meta classes of the named entities within the information model.

IrirRef

Is a subtype of Data model/Node shape

A reference to resource with an iri and optional name to enable readability

Property Card. Value type Description
name 1..1 xsd:string The name of the entity
Example
{"@id" : "sn:29857009", "name" : "Chest pain (finding)"}

Entity

Is a subtype of Data model/Node shape

The abstract super class and data model for all named entities in the model i.e. the data model of the entities that are labelled with iri label and status

Property Card. Value type Description
label 1..1 xsd:string The preferred full name of the entity
type 1..1 rdfs:Resource The base type of the entity i.e. one of the high level entity types
comment 0..1 xsd:string The description of the entity
status 1..1 im:Status The status of the entity being active, inactive, draft or unassigned
scheme 1..1 im:Graph The code scheme or graph which the entity belongs to
isContainedIn 0..1 Folder An entity that this entity inherits from, both semantically and structurally, this is also used for sub properties as properties are classes of properties
370124000 0..1 Entity When a status is inactive, the entity that replaces this entity (if any)

Folder

Is a subtype of Entity

Folder containing subfolders or entities

Property Card. Value type Description

IriAlias

Is a subtype of IrirRef

An IRI with a name and an optional alias and a variable name when the iri is passed in as an argument (e.g. $this

Property Card. Value type Description
alias 0..1 xsd:string The column name in a select clause for this property, or a variable used to reference the result set of the values matched
variable 0..1 xsd:string The name of a variable, passed as an argument to the query, which is resolved to the IRI
inverse 0..1 xsd:boolean When used as a property, whether this is an inverse object property i.e. an inbound connection to this entity
includeSubtypes 0..1 xsd:boolean When used in a with or where clause, whether to include the subtypes of this entity
includeSupertypes 0..1 xsd:boolean When used in a with or where clause, whether to include the supertypes of this entity e.g. when ascending a hierrchy to look for a property
or
0..1
isType 0..1 xsd:boolean If the query results are derived from instances of certain type (or types) then set this flag to true.

isSet

0..1 xsd:boolean If the query results derived the result set of a concept set, value set or query result then set this flag to true.

Function

Defines the shape of an instance of the target class : FunctionClause

Is a subtype of Entity

Data model of a function i.e. models the parameters. A query that calls a function uses a function clause that uses this function definition to name each argument passed in

Property Card. Value type Description
parameter 0..* Parameter A list of parameters and data types used in this function

Parameter

Models a named parameter used in function or other clauses. The parameter name and data type of the parameter (if literal) or class (if on object)

Property Card. Value type Description
label 1..1 xsd:string The name of the parameter
or
1..1
datatype 1..1 rdfs:Resource The iri of The data type of the parameter when the data type is a literal

class

1..1 rdfs:Resource The iri of the class of the parameter when the argument is an object
query 0..1 im:Query The iri of the query used to generate the value of the parameter passed as an argument

IriVariable

Is a subtype of IrirRef

A variable, usually passed in as a parameter to a function, with an optional IRI and whether the iri is an instance or type iri (if ambiguous)

Property Card. Value type Description
variable 0..1 xsd:string The name of a variable, passed as an argument to a function. Assumed to be a collection
isType 0..1 xsd:boolean In cases where it is ambiguous whether an iri refers to an instance or type, then set this to true if a type

Property

Is a subtype of Entity

A property data model

Property Card. Value type Description
inverseOf 0..1 rdf:Property A property that this property is an inverse of
domain 0..1 rdfs:Class The classes or concepts that may have this property as a property, or a role, or a role within a role group
range 0..1 Class the type of value for this property.

Entity selector

Is a subtype of Entity

A list of entities to select at particular points in a business process.

Property Card. Value type Description
list 0..1 xsd:string The list of entities by iri to select from

Data Model shapes

These shapes are the meta classes of the data modelling entities within the information model.

Data model/Node shape

Is a subtype of Entity

The meta class for shapes, those shapes defining a type i.e the shape of a shape

Property Card. Value type Description
isContainedIn 0..1 Folder
subClassOf 0..1 NodeShape
property 0..1 PropertyShape The list of properties for this shape

Concept shapes

These shapes are the meta classes of the terminology concepts used within the information model.

Terminology concept

Is a subtype of Entity

data model for terminology concepts

Property Card. Value type Description
subClassOf 0..1 Concept The concept this concept is a sub type of
code 1..1 xsd:string The code for this concept, which may be a local code if local concept, or a core code such as a snomed identifier
hasTermCode 0..1 TermCodeShape Alternative terms or synonyms for this concept. A term may also have a description id.
weighting 0..1 xsd:integer A number indicating a weighting for this concept which can be used in free text search
definitionalStatus 0..1 im:VSET_Definitionalstatus Indicates the authoring status of this concept, whether necessary only, or both necessary and sufficient. OWL would use Equivalent class axiom to indicate this.
hasMap 0..1 xsd:string Any backward maps from core to legacy. This is limited to complex maps rather than simple matches and are 'backward' matches not suitable for automatic inclusion in subsumption queries
usageTotal 0..1 xsd:integer The approximate number of times this concept has been used in around 1 million primary care and acute care records
im1Id 0..1 xsd:string pointer the original identifer in IM1
matchedTo 0..1 im:VSET_Unspecified For a legacy concept, one or more concept this concept matches to. A query for the matched to concepts would entail this concept normally, but NOT the children of this concept
370124000 0..1 Concept Indicates the concepts that this concept has been replaced by
isChildOf 0..1 Concept points to the parent legacy concept that this concept is in. Note that it may or may not be a true subtype. Reflects the original taxonomy

Term code shape

Is a subtype of Data model/Node shape

data model for a term code

Property Card. Value type Description
label 0..1 xsd:string The term or synonym for the concept
code 0..1 xsd:string Descriptionid or code for this particular term
status 0..1 im:Status The status of this particular term code, may be active or inactive

Refined concep

Is a subtype of Terminology concept

A concept with role groups with roles

Property Card. Value type Description
roleGroup 0..1 RoleGroupShape Zero or many role groups, each group containing one or more roles. These represent constraints on the super types i.e. more specific. Generated by inference making sure to remove duplicate properties or super properties.

Role group shape

Is a subtype of Data model/Node shape

data model for a role group

Property Card. Value type Description
Property 0..1 Concept The concept identifier of the concept that is the role. Role Groups are unique in that their properties are any properties from an ontology,usually concepts

Codeable concept

Is a subtype of IrirRef

A coded concept used in a health record system that may or may not be a defined concept in the ontology. It represents the local definition of a code and is of the form used in HL7 messaging

Property Card. Value type Description
matchedConcept 0..1 IriRef The core concept iri that this codeable concept has been matched to in this instance
originalCode 0..1 xsd:string The original code entered in the publication system which may be mapped to a code concept
originalScheme 0..1 xsd:string The original code scheme identifier, may be a url or a OID or informal identifier
originalCodeTerm 0..1 xsd:string The original display term for this code usually as a reference. Should not be confused with original text as seen by the user, which may be different depending on the context
originalQualifierTerm 0..1 xsd:string A qualifier term in the original system which may result in a different concept map. For Example 'negative' or 'positive' or a block of text

Query Model and Set definition shapes

These shapes form the model for defining sets (also known as query definitions) for retrieving data from the IM or health records.

Data set

Is a subtype of Query

A query that produces a data set as an output is stored as an entity in a query library

Property Card. Value type Description

Query

Is a subtype of Entity

A query that is stored as an entity in a query library

Property Card. Value type Description
definition 0..1 QueryDefinition The query definition itself

Query definition

Is a subtype of IriAlias

A set definition holding the logical definition of a set. Usually referred to as a Query as these are used to retrieve data.
Includes most of the main logical query constructs used in mainstream query languages, thus is a constrained version of mainstream languages that is schema independent.

Property Card. Value type Description
description 0..1 xsd:string Optional description of the query definition for support purposes.
from 0..* IriAlias The base cohort/ set or type(s), or instance(s) on which all the subsequent where or filter clauses operate. If more than one this is treated as an OR list.
where 0..1 WhereClause Tests properties and property paths and applies filters. Equivalent to SQL Join/ Where and SPARQL Where
Bollean where clauses supported.
return 1..1 SelectClause Return query clause logically similar to SQL/SPARQL select but with GraphQL nesting ability
groupBy 0..* IriAlias If the results need to be grouped, the grouping properties.
orderBy 0..* IriAlias Ordering of instances via a property value returned.
direction 0..1 xsd:string direction of ordering (DESC or ASC) .
limit 0..1 xsd:integer Number of entities to return. Normally used with order by
having 0..1 HavingClause Tests an aggregate result from the group clause for a value
subQuery 0..* QueryDefinition SubQueries used to group columns in multi group reports. The sub queries are all subsets of the main query clauses
prefix 0..0 PrefixShape list of prefix to namespace expansion to enable readability of iris
usePrefixes 0..1 xsd:boolean true if you want the results to use IRI prefixes
activeOnly 0..1 xsd:boolean Whether only active entities are included in the match clauses or select clauses

WhereClause

A clause containing criteria which the objects must conform to. Equivalent to a from/join where clause in SQL and where/filter in sparql.
Supports graph traversal filtering and inference for subsumption query

Property Card. Value type Description
alias 0..1 xsd:string Used to define the clause with a readable term and also used in other clauses for further refinement
description 0..1 xsd:string Optional description for clause
from 0..* IriAlias Refers
a) to the alias of another where clause to indicate the set of objects defined by the referenced clause, which will be further refined by this where clause.
Equivalent to accessing a temporary or derived table in SQL.
(b) One or more instance objects to test properties of
(c) or instances of a certain type(s)
(d) external result set (e.g. a base cohort population)
If more than one it is considered an OR List.
Represents a subject of a triple or entity. Should be used with caution in IM query
graph 0..1 im:Graph The iri of a graph if the query is limited to a particular data set
pathTo 0..1 rdfs:Resource A property type path made up of space delimitediri strings, from the outer entity to the entity on which this clause operates. Alternates property and type
Equivalent to an inner join in SQL
notExist 0..1 WhereClause Points to a nested where clause. If the nested clause returns results then the entity referenced by the outer where clause is excluded.
In other words, for the outer entity to be included, the nested entity must have no results. This contrasts with 'not'
or 2..* WhereClause Boolean operator OR on subclauses
and 2..* WhereClause Boolean operator AND on subclauses
property 0..* IriAlias a property tgo test. Note that this is applied to the entity after the path has been resolved.
in 0..* IriRef Whether the value is in this list of sets or concepts (including any sub types)
is 0..* IriAlias Whether the value is this concept (and optionally if set to include sub or supertypes)
not 0..1 xsd:boolean Testing for the value as a not. Note that this filters out the instances but does not exclude the outer entity (see not exist)
function 1..1 FunctionClause A function that operates on the property value (and other parameters) prior to a compare or range or inclusion test. For example a time difference function operating on the date and a reference date.
Note that properties that ARE functions do not need functions included for example age. For these simply supply the arguments.
or
0..1
within 0..1 WithinClause Where the value is within a range of another value
Note that if the test is a function then the argument list would be in the function clause

value

1..1 ValueClause If testing a property value as equal greater than ete. use compare
range 1..1 RangeClause Test foe a value being between two absolute or relative values
where 1..1 WhereClause A chained where clause operating on the property value object.
Equivalent to a join in SQL or '.' in sparql
orderBy 0..* IriAlias Ordering of instances via a property value in order to further test in another where clause.
direction 0..1 xsd:string direction of ordering (DESC or ASC) .
limit 0..1 xsd:integer Number of entities to return. Normally used with order by

SelectClause

Defines the objects and properties to retrieve from a graph, subject to a mach clause. Supports graphql type nesting and sub selects for column groups

Property Card. Value type Description
path 0..1 rdfs:Resource A property path made up of space delimited iri strings, from the outer entity to the entity on which this clause operates.
Shortcut for nested selects
property 1..1 IriAlias Information about a property or field to include in the results. Property select supports nesting with selects for the objects that may be values of the property
select 0..* SelectClause Nested select property clauses from the objects that are values of this select's property Note that if the value is null then this select would be absent
where 0..* WhereClause Nested where clause operating on the values of this select's property
Enables multi- level filtering as used in JOIN where clauses in SQL
groupBy 0..* IriAlias If the results need to be grouped, the grouping properties.
orderBy 0..* IriAlias Ordering of instances via a property value returned.
direction 0..1 xsd:string direction of ordering (DESC or ASC) .
limit 0..1 xsd:integer Number of entities to return. Normally used with order by
having 0..1 HavingClause Tests an aggregate result from the group clause for a value
aggregate 0..1 xsd:string Name of an aggregate function to operate on the property
function 0..1 im:FunctionClause The iri of a function indicating that the result is the result of a function operating on the property values, and any arguments passed in
argument 0..* Argument Arguments to pass into the function

Having clause

A clause testing an aggregate function on a property usually one that is grouped

Property Card. Value type Description
aggregate 0..1 xsd:string Name of the aggregate function e.g. MAX,MIN,COUNT,SUM, AVERAGE
property 0..1 IriAlias The property on which the aggregate function operates
value 0..1 ValueClause The value of the aggregate result to be tested

Prefix shape

The model of a class containing an iri prefix map

Property Card. Value type Description
prefix 1..1 xsd:string Prefixe used in the rest of the document
iri 1..1 xsd:string The iri or namespace or graph iri this prefix refers to

FunctionClause

Is a subtype of IrirRef

A call to a function used in a query consisting of the function iri and one or more arguments to pass in at run time

Property Card. Value type Description
argument 0..* Argument Arguments to pass into the function. They should match the parameter definitions of the function

Within clause

Tests a value against another value, either as comparison or range

Property Card. Value type Description
or
1..1
value 1..1 ValueClause The test is for an actual value (including comparison against another value

range

1..1 RangeClause The test is for a range of values against another value
of 1..1 CompareClause The alias and property the value test is against

ValueClause

Tests a value, whether equal, greater than, less than etc. optionally including a value to compare against

Property Card. Value type Description
<span title="Comparison operators : =, <, <=, >, >=">comparison 1..1 xsd:string Comparison operators : =, <, <=, >, >=
or
1..1
value 1..1 xsd:string The value of the property used in a test. This is a string which will be cast to a number or date, depending on the data type of the property value

valueOf

0..1 CompareClause The value is the value of a variable or property set elsewhere in the query
unitOfTime 1..1 xsd:string When the target value or value of is a date and the value is a number then the units of time e.g. years or months as a parameter to a function

RangeClause

A range for use in property value testing

Property Card. Value type Description
from 1..1 ValueClause The value comparison for lower end of the range
to 1..1 ValueClause The value comparison of upper end of the range

Argument

A named parameter and a value for passing into a function

Property Card. Value type Description
parameter 1..1 xsd:string Parameter name for a function or the parameter name for an argument
or
1..1
valueData 1..1 xsd:string Value that is a literal such as a string or number

valueVariable

1..1 xsd:string argument value which is a variable name to be resolved at run time
valueFrom 1..1 xsd:string Passes in the result set from a previous where clause
valueObject 0..1 xsd:string Function specific paylod object, normally a json object deserialized to object as determined by the function

CompareClause

When comparing a value to another variable's value this defines the target to compare against. Might be property, alias of a property, or a variable value

Property Card. Value type Description
alias 0..1 xsd:string The alias of the result set from another where clause
property 0..1 IriAlias The property of the objects in the result set (as indicated by the alias) to test
variable 0..1 xsd:string If a value is being compared against a variable passed in as an argument, the name of the variable

FunctionShape

Defines the shape of an instance of the target class : FunctionClause

Is a subtype of Entity

Data model of a function i.e. models the parameters. A query that calls a function uses a function clause that uses this function definition to name each argument passed in

Property Card. Value type Description
parameter 0..* Parameter A list of parameters and data types used in this function

Path Query

Is a subtype of Data model/Node shape

A query that returns a set pf paths between a source and target entity, traversing to a certain level

Property Card. Value type Description
source 1..1 IriRef the source entity at the start of the path.
target 1..1 IriRef the target entity at the end of the path.
depth 0..1 xsd:integer How many hops to be taken in the graph between source and target

Set

Is a subtype of Entity

data model for concept sets and value sets

Property Card. Value type Description
definition 0..1 QueryDefinition The query definition itself
hasMember 0..1 Concept The flat list of leaf concepts when generated from the definition, or for many national sets, simple list of concepts

Transform map shapes

These shapes form the model for transformation maps used by a engine to transform from a source to destination data model. Based on FHIR mapping language

Transactional shapes

These shapes form the meta classes for structures pass into APIs for query of, or filing into, the model or health records.

EntityFileTransaction

Is a subtype of Entity

An entity with the additional CRUD indicators to enable deletes updates, adding quads etc

Property Card. Value type Description
crud 1..1 im:CrudOperation Indicates the nature of the CRUD transaction which must be one of im:DeleteAll, im:AddQuads (adds in additional triples), im:UpdateAll (replaces all the predicates for this entity in the graph with te ones submitted), im:UpdatePredicates ( replaces all the objects of these submitted predicates for this graph
graph 1..1 im:Graph The graph to which these triples apply.
This means you can add predicates to any entity without affecting the original authored entity, those predicates belonging only to this module or graph

EntityDocument

A document containing any number of triples to file as a batch.
Note that if the document is sent as Json-LD with prefixed iris, a @context object will be required

Property Card. Value type Description
crud 1..1 im:CrudOperation Indicates the nature of the default CRUD transaction for entities in thisdocument. Thes can be overridden in each entity. Must be one of: im:DeleteAll, im:AddQuads (adds in additional triples), im:UpdateAll (replaces all the predicates for this entity in the graph with te ones submitted), im:UpdatePredicates ( replaces all the objects of these submitted predicates for this graph
graph 1..1 im:Graph The graph to which these entities apply by default.
This may be overridden by the entities
This means you can add predicates to any entity without affecting the original authored entity, those predicates belonging only to this module or graph
entities 1..* Entity Set of entities to file. If the entities do not have crud or graphs oftheir own then the default from the document are used