Vessels#

About#

OIH is exploring how we might leverage schema.org to describe research vessels.
Note that schema.org is a very broad vocabulary and as such specific concepts like research vessel is not well aligned to current types.

In Schema.org the type Vehicle is described as a device that is designed or used to transport people or cargo over land, water, air, or through space. We have used this broad scoping to cover research vessels. We could go on to connect this type then to a descriptive property in a concept such as the WikiData entry for Research Vessel, Q391022. We may also wish to leverage some of the approaches in Keywords and Defined Terms.

Our goal is to use schema.org as a simple upper level vocabulary that allows us to describe research vessels in a simple manner and then connect to more detailed information on them.

So the goal here is to show how we can use schema.org as a discovery layer and then link more directly to detailed institutional metadata records.

This may also leverage the approaches similar to what is shown in the Publishing Principles resources.

Observing Infrastructure in general represents an interesting challenge. A specified infrastructure could be referenced as a ResearchProject within Schema.org, though other types would be explored. One could also build off the base Thing class, parent to all Schema.org types, then leverage the property schema.org/instrument, itself of type Thing. This approach provides an initial starting point to build out the approach.

It should be noted that schema.org/Observation also exists but can only currently be used with the property schema.org/diseaseSpreadStatistics. However, if seen useful, there is the potential to connect Observation back to a type of Infrastructure that does not currently exist in Schema.org but could be proposed.

Addressing the challenge of Observation Infrastructure, and potentially revisiting the current OIH type Vessel, may involve engagement with Schema.org itself, something they encourage.

 1{
 2    "@context": {
 3        "@vocab": "https://schema.org/"
 4    },
 5    "@id": "https://example.org/id/X",
 6    "@type": "Vehicle",
 7    "name": "JOIDES Resolution",
 8    "identifier": {
 9        "@id": "https://example.org/id/vessel/X",
10        "@type": "PropertyValue",
11        "propertyID": "https://en.wikipedia.org/wiki/IMO_number",
12        "url": "https://example.org/id/vessel/X",
13        "description": "Vessel ID "
14    },
15    "countryOfLastProcessing": "Angola",
16    "countryOfOrigin": {
17        "@type": "Country",
18        "name": "Fiji"
19    },
20    "additionalProperty": {
21        "@id": "ID_value_string",
22        "@type": "PropertyValue",
23        "propertyID": "https://en.wikipedia.org/wiki/IMO_number",
24        "url": "https://foo.org/linkToPropertyIDPage",
25        "description": "Any additional properties for the vessel"
26    },
27    "subjectOf": {
28        "@type": "DataDownload",
29        "name": "external-metadata.xml",
30        "description": "Metadata describing the vessel",
31        "encodingFormat": [
32            "application/xml",
33            "https://foo.org/ship01"
34        ],
35        "dateModified": "2019-06-12T14:44:15Z"
36    }
37}
Hide code cell source
import json
from pyld import jsonld
import os, sys

currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils


with open("../../../odis-in/dataGraphs/thematics/vessels/graphs/ship.json") as dgraph:
    doc = json.load(dgraph)

context = {
    "@vocab": "https://schema.org/",
}

compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/tmp/ipykernel_3786/1146838844.py in <module>
     17 
     18 compacted = jsonld.compact(doc, context)
---> 19 jbutils.show_graph(compacted)

~/work/odis-arch/odis-arch/book/lib/jbutils.py in show_graph(doc, size)
     45         subj = short_name(edge['subject'])
     46         obj = short_name(edge['object'])
---> 47         pred = short_name(edge['predicate'])
     48         if subj and obj and pred:
     49             # Apply different styles to the nodes based on whether they're

~/work/odis-arch/odis-arch/book/lib/jbutils.py in short_name(value, max_length)
     22             # If the URL is too long, hide it
     23             if len(short_url) > max_length:
---> 24                 pieces = split_uri(short_url)
     25                 return join_uri(pieces[0], '...')
     26             else:

NameError: name 'split_uri' is not defined

Details: Indentifier#

For each profile there are a few key elements we need to know about. One key element is what the authoritative reference or canonical identifier is for a resource.

Hide code cell source
import json
from rdflib.extras.external_graph_libs import rdflib_to_networkx_multidigraph
from rdflib.extras.external_graph_libs import rdflib_to_networkx_graph
from pyld import jsonld
import graphviz
import os, sys

currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils

with open("../../../odis-in/dataGraphs/thematics/vessels/graphs/ship.json") as dgraph:
    doc = json.load(dgraph)

frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Vehicle",
  "identifier": ""
}

context = {
    "@vocab": "https://schema.org/",
}

compacted = jsonld.compact(doc, context)

framed = jsonld.frame(compacted, frame)
jd = json.dumps(framed, indent=4)
print(jd)

jbutils.show_graph(framed)
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/X",
    "@type": "Vehicle",
    "identifier": {
        "@id": "https://example.org/id/vessel/X",
        "@type": "PropertyValue",
        "description": "Vessel ID ",
        "propertyID": "https://en.wikipedia.org/wiki/IMO_number",
        "url": "https://example.org/id/vessel/X"
    }
}
../../_images/3034de34f8257711c8409fd6d96c57586d88059c212a56a05d616e238c96b8cb.svg

Details: subjectOf#

Like SOS, we are recommending the use of subjectOf to link a simple Schema.org type to a more detailed metadata description record. This allows us to use the easy discovery layer in Schema.org but connect to domain specific metadata records.

Hide code cell source
import json
from rdflib.extras.external_graph_libs import rdflib_to_networkx_multidigraph
from rdflib.extras.external_graph_libs import rdflib_to_networkx_graph
from pyld import jsonld
import graphviz
import os, sys

currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils

with open("../../../odis-in/dataGraphs/thematics/vessels/graphs/ship.json") as dgraph:
    doc = json.load(dgraph)

frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Vehicle",
  "subjectOf": ""
}

context = {
    "@vocab": "https://schema.org/",
}

compacted = jsonld.compact(doc, context)

framed = jsonld.frame(compacted, frame)
jd = json.dumps(framed, indent=4)
print(jd)

jbutils.show_graph(framed)
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/X",
    "@type": "Vehicle",
    "subjectOf": {
        "@type": "DataDownload",
        "dateModified": "2019-06-12T14:44:15Z",
        "description": "Metadata describing the vessel",
        "encodingFormat": [
            "application/xml",
            "https://foo.org/ship01"
        ],
        "name": "external-metadata.xml"
    }
}
../../_images/a2728002060b51fbba3c63bdac10fd7ba6a64d70bfe601d04a08013adc92244f.svg

References#