Caveats when Working With a JSON Project File
Referencing Ontologies
For several fields (e.g. super
in both resources
and properties
, or propname
in cardinalities
),
it is necessary to reference entities that are defined elsewhere. The following cases are possible:
- DSP-API internals:
- They are referenced as such and do not have a leading colon,
e.g.Resource
,DocumentRepresentation
orhasValue
- They are referenced as such and do not have a leading colon,
- An external ontology:
- The prefix of the ontology must be declared in the "prefixes" object.
- The prefix can then be used for referencing the corresponding external ontology,
e.g.foaf:familyName
orsdo:Organization
- The current ontology:
- Within the same ontology, references can be made by prepending a colon without a prefix
:
,
e.g.:hasName
. - Optionally, the current ontology can be referenced by its
name
,
e.g.sameOnto:hasName
- It is not necessary to add
sameOnto
to the "prefixes" object.
- Within the same ontology, references can be made by prepending a colon without a prefix
- A different ontology defined in the same file:
- Within one data model file, multiple ontologies can be defined.
These will be created in the exact order they appear in the
ontologies
array. - Once an ontology has been created,
it can be referenced by the following ontologies by its
name
,
e.g.first-onto:hasName
- It is not necessary to add
first-onto
to "prefixes" object.
- Within one data model file, multiple ontologies can be defined.
These will be created in the exact order they appear in the
DSP Base Resources and Base Properties to be Used Directly in the XML File
From several DSP base resources, no subclasses can be created in a project ontology. However, they can be used directly in the XML data file:
Annotation
is an annotation to another resource of any class. It can be used in the XML file with the <annotation> tag and has the following predefined properties:hasComment
(1-n)isAnnotationOf
(1)
LinkObj
is a resource linking together several other resources of different classes. It can be used in the XML file with the <link> tag and has the following predefined properties:hasComment
(1-n)hasLinkTo
(1-n)
- A
Region
resource defines a region of interest (ROI) in an image. It can be used in the XML file with the <region> tag and has the following predefined properties:hasColor
(1)isRegionOf
(1)hasGeometry
(1)hasComment
(1-n)
There are some DSP base properties that are used directly in the above-mentioned resource classes. Subclasses can be created from some of them in the project ontology.
hasLinkTo
: a link to another resource- subclasses can be created from it (hasLinkTo Property)
- can be used directly in the XML data file in the <link> tag
hasColor
: Defines a color value.- subclasses can be created from it (ColorValue)
- can be used directly in the XML data file in the <region> tag
hasComment
: Defines a standard comment.- subclasses can be created from it (hasComment Property)
- can be used directly in the XML data file in the <region> tag or <link> tag
hasGeometry
: Defines a geometry value (a JSON describing a polygon, circle or rectangle).- must be used directly in the XML data file in the <region> tag
isRegionOf
: A special variant ofhasLinkTo
. It means that the given resource class is a region of interest in an image.- must be used directly in the XML data file in the <region> tag
isAnnotationOf
: A special variant ofhasLinkTo
. It means that the given resource class is an annotation to another resource class.- must be used directly in the XML data file in the <annotation> tag