33    "name": "National Science Foundation",
 34    "legalName": "National Science Foundation",
 35    "alternateName": "NSF",
 36    "url": "https://www.nsf.gov/",
 37    "identifier": {
 38      "@id": "https://example.org/id/resproj/X",
 39      "@type": "PropertyValue",
 40      "propertyID": "https://registry.identifiers.org/registry/doi",
 41      "value": "DOI value expressed as doi:{doi}",
 42      "url": "https://dio.org/id/XYZ"
 43    }
 44  },
 45  "funding": [
 46    {
 47      "@id": "{odo:hasAward -> odo:osprey_page}",
 48      "@type": "MonetaryGrant",
 49      "url": "http://www.someinstitute.edu",
 50      "name": "{odo:hasAward -> odo:hasAwardNumber}",
 51      "identifier": "{odo:hasAward -> odo:hasAwardNumber}",
 52      "funder": [
 53        {
 54          "@id": "https://dx.doi.org/10.13039/10000001"
 55        },
 56        {


55        },
 56        {
 57          "@type": "FundingAgency",
 58          "name": "Some other org",
 59          "url": "https://example.funder.org/"
 60        }
 61      ]
 62    }
 63  ],
 64  "ethicsPolicy": {
 65    "@type": "CreativeWork",
 66    "@id": "https://example.org/id/XYZ",
 67    "name": "Name or title of the document",
 68    "description": "Description of the creative work ",
 69    "url": "https://www.foo.org/creativework/ethicsPolicy.pdf"
 70  },
 71  "diversityPolicy": {
 72    "@type": "CreativeWork",
 73    "@id": "https://example.org/id/ABC",
 74    "name": "Name or title of the document",
 75    "description": "Description of the creative work",
 76    "url": "https://www.foo.org/creativework/diversityPolicy.pdf"
 77  },
 78  "areaServed": [
 79    {
 80      "@type": "Place",
 81      "geo": {


80      "@type": "Place",
 81      "geo": {
 82        "@type": "GeoCoordinates",
 83        "latitude": 39.3280,
 84        "longitude": 120.1633
 85      },
 86      "description": "Description of the area served"
 87    },
 88    {
 89      "@type": "Text",
 90      "description": "Textual description of area served"
 91    },
 92    {
 93      "@type": "AdministrativeArea",
 94      "geo": {
 95        "@type": "GeoCoordinates",
 96        "latitude": 39.3280,
 97        "longitude": 120.1633
 98      },
 99      "description": "Needs to be subset of Place, Review Place"
100    }
101  ],
102  "parentOrganization": {
103    "@type": "Organization",
104    "@id": "http://www.someinstitute.edu",
105    "legalName": "Some Institute",
106    "name": "SI",
107    "url": "http://www.someinstitute.edu",
108    "address": {
109      "@type": "PostalAddress",


108    "address": {
109      "@type": "PostalAddress",
110      "streetAddress": "234 Main St.",
111      "addressLocality": "Anytown",
112      "addressRegion": "ST",
113      "postalCode": "12345",
114      "addressCountry": "USA"
115    }
116  }
117}
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/projects/graphs/proj.json") as dgraph:
    doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
References#
https://schema.org/Project


Source and Prov Approaches#
About#
This section will present an identifer discussion and then focus
on approaches publishers can use to provide more source and provenance
information.This section is heavily influenced
by [1] [2]  and the reader is highly
encouraged to read these references.
It is not uncommon for a single resource to be described at multiple locations.
The following items represent properties that can help address the
disambiguation of resources as the Ocean InfoHub graph grows.
We will look at the following seven properties:
identifier, provider, publisher, sameAs, isBasesOn, subjectOf and its
inverse, about.
It should be noted that only subjectOf and sameAs can be used on type
Thing.  That is, these properties can be used on any Schema.org type.
The others have their domain and range values listed.  All these
properties work on CreativeWork. So they are all valid for that type
and subtypes like Dataset and Map.
Example Graph#
The following example graph shows some of the properties we can use
to provide source and provenance information about a resource.
 1{
 2    "@context": {
 3        "@vocab": "https://schema.org/"
 4    },
 5    "@id": "https://example.org/id/XYZ",
 6    "@type": "CreativeWork",


6    "@type": "CreativeWork",
 7    "url": "https://example.org/url/of/the/item",
 8    "sameAs": "https://doi.org/10.5066/F7VX0DMQ",
 9    "isBasedOn": "https://example.org/id/xyz",
10    "identifier": {
11        "@id": "https://doi.org/10.5066/F7VX0DMQ",
12        "@type": "PropertyValue",
13        "propertyID": "https://registry.identifiers.org/registry/doi",
14        "url": "https://doi.org/10.5066/F7VX0DMQ",
15        "value": "doi:10.5066/F7VX0DMQ"
16    },
17    "subjectOf": {
18        "@type": "CreativeWork",
19        "@id": "http://purl.unep.org/sdg/SDGIO_00020173",
20        "url": "http://www.ontobee.org/ontology/SDGIO?iri=http://purl.unep.org/sdg/SDGIO_00020173",
21        "name": "UNSD SDG indicator code:C140c01",


21        "name": "UNSD SDG indicator code:C140c01",
22        "description": "Number of countries making progress ... the oceans and their resources"
23    },
24    "provider": {
25        "@id": "https://www.sample-data-repository.org",
26        "@type": "Organization",
27        "legalName": "Sample Data Repository Office",
28        "name": "SDRO",
29        "sameAs": "http://www.re3data.org/repository/r3dxxxxxxxxx",
30        "url": "https://www.sample-data-repository.org"
31    },
32    "publisher": {
33        "@id": "https://www.sample-data-repository.org"
34    }
35}
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/identifier/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)


compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
identifier#
This is the main subject of the start of this section.  Please
refer there for details on this property.
Values expected to be one of these types
PropertyValue
Text
URL
Used on these types
Thing
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/identifier/graphs/creativework.json") as dgraph:


doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "identifier": {


"@type": "CreativeWork",
    "identifier": {
        "@id": "https://doi.org/10.5066/F7VX0DMQ",
        "@type": "PropertyValue",
        "propertyID": "https://registry.identifiers.org/registry/doi",
        "url": "https://doi.org/10.5066/F7VX0DMQ",
        "value": "doi:10.5066/F7VX0DMQ"
    }
}
propertyID#
A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be (1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific id of the property), or (3) a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry). Standards bodies should promote a standard prefix for the identifiers of properties from their standards.
value#
The value of the quantitative value or property value node. For PropertyValue,
it can be ‘Text;’, ‘Number’, ‘Boolean’, or ‘StructuredValue’.
url (pointing to type URL)#
URL of the item.


url (pointing to type URL)#
URL of the item.
provider#
schema.org/provider
The service provider, service operator, or service performer; the goods
producer. Another party (a seller) may offer those services or goods on behalf
of the provider. A provider may also serve as the seller.
For OIH this is the agent that is responsible for distributing the resource
and the descriptive metadata.  That is, the provider actually runs and supports
the services that presents the resource on the net or otherwise makes the
data available.
Values expected to be one of these types
Organization
Person
Used on these types
CreativeWork
EducationalOccupationalProgram
Invoice
ParcelDelivery
Reservation
Service
Trip
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/identifier/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {


doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "provider": ""
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "provider": {


"@type": "CreativeWork",
    "provider": {
        "@id": "https://www.sample-data-repository.org",
        "@type": "Organization",
        "legalName": "Sample Data Repository Office",
        "name": "SDRO",
        "sameAs": "http://www.re3data.org/repository/r3dxxxxxxxxx",
        "url": "https://www.sample-data-repository.org"
    }
}
publisher#
See: schema.org/publisher
The publisher is defined as “The publisher of the creative work”.  This is
viewed as the agent that is primarily responsible for making the content described
by the structured metadata.
Values expected to be one of these types
Organization
Person
Used on these types
CreativeWork
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/identifier/graphs/creativework.json") as dgraph:


doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "publisher": ""
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "publisher": {


"@type": "CreativeWork",
    "publisher": {
        "@id": "https://www.sample-data-repository.org",
        "@type": "Organization",
        "legalName": "Sample Data Repository Office",
        "name": "SDRO",
        "sameAs": "http://www.re3data.org/repository/r3dxxxxxxxxx",
        "url": "https://www.sample-data-repository.org"
    }
}
sameAs#
See: schema.org/sameAs
The sameAs property links a Thing to a URL.  It is expected that the
URL is a resource that is the the most canonical URL for the original.
In cases where your resource is not the canonical URL, you can use the
sameAs property to link to the canonical URL.  This is useful when you wish
to publish a resource and give credit to the original resource.  Note,
in this case the resource must not be altered, but actually be the same
as the canonical URL resource.
The sameAs property should always point to only one resource.  It is not
logically consistent to point to multiple sameAs resources.
Values expected to be one of these types
URL
Used on these types
Thing
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/identifier/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "sameAs": ""
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "sameAs": "https://doi.org/10.5066/F7VX0DMQ"
}
isBasedOn#
See: schema.org/isBasedOn
Where sameAs is used to link to the canonical URL of the resource, isBasedOn
provides a means to link derivative works to the original resource this new
resources is based on.
The isBasedOn property can be used to link to multiple resources if more
than one was used in the generation of this new resource.
Values expected to be one of these types
CreativeWork
Product
URL
Used on these types
CreativeWork
subjectOf and inverse about#
See: schema.org/subjectOf
The property subjectOf of can be used to indicate a resource that is related to
the described resource, although not necessarily a part of it. The subjectOf
property can be used in an educational framework to indicate the field(s) of
science or literature the dataset relates to.
Values expected to be one of these types
CreativeWork
Event


Values expected to be one of these types
CreativeWork
Event
Used on these types
Thing
The subjectOf property has an inverse-property about.
The property about can be used to:
indicate the subject matter this thing is about
Values expected to be one of these types
Thing
Used on these types
CreativeWork
Event
CommunicateAction
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/identifier/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "subjectOf": ""
}
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)


}
compacted = jsonld.compact(doc, context)
framed = jsonld.frame(compacted, frame)
jd = json.dumps(framed, indent=4)
print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "subjectOf": {
        "@id": "http://purl.unep.org/sdg/SDGIO_00020173",
        "@type": "CreativeWork",
        "description": "Number of countries making progress ... the oceans and their resources",
        "name": "UNSD SDG indicator code:C140c01",


"name": "UNSD SDG indicator code:C140c01",
        "url": "http://www.ontobee.org/ontology/SDGIO?iri=http://purl.unep.org/sdg/SDGIO_00020173"
    }
}
References#
1
Omar Benjelloun, Shiyu Chen, and Natasha Noy, editors. Google Dataset Search by the Numbers, 2020. URL: https://arxiv.org/abs/2006.06894.
2
Google search central dataset. https://developers.google.com/search/docs/advanced/structured-data/dataset. URL: https://developers.google.com/search/docs/advanced/structured-data/dataset.


Linking to documents and resources#
Leveraging the ability to link between resources can serve many goals.  We may
wish to demonstrate connections between people and courses they have taken or
or organizations they are connected with.   We may be wishing to link documents
to people or organizations.
This section will review two key thematic profiles and some examples of how to
express links from them to other resources.   Our goal will be different in various
cases.  The two profiles are type CreativeWork and type Organization.
In the case of Organization our purpose may be to express alignment to various
principles and policies.  These might provide people with an understanding of
the goals of an organization when they are searching for or assessing them.
In the case of CreativeWork we are looking to express connections to the
publisher and provider of the creative work.   This is mostly to connect these
works with the responsible party associated with them but may also serve to
connect to the principles they are associated with.
Organization link options#
In the following section we will look at three different options for expressing
links between an organization and resources that describe the policy and
principles of the subject organization.
First we will see the full data graph.  We have highlighted the sections we
we will review here.  Namely the subjectOF and publishingPrinciples
predicates.
 1{
 2    "@context": {


predicates.
 1{
 2    "@context": {
 3        "@vocab": "https://schema.org/"
 4    },
 5    "@id": "https://example.org/id/org/x",
 6    "@type": "Organization",
 7    "address": {
 8        "@type": "PostalAddress",
 9        "addressLocality": "Paris, France",
10        "postalCode": "F-75002",
11        "streetAddress": "38 avenue de l'Opera"
12    },
13    "email": "secretariat(at)example.org",
14    "name": "Organization X",
15    "description": "Description of org ...",
16    "telephone": "( 33 1) 42 68 53 00",
17    "member": [
18        {
19            "@type": "Organization",
20            "name": "Organization A",
21            "description": "Org A is a potential parent organization of Org X"
22        }
23    ],
24    "identifier": {
25        "@id": "https://grid.ac/institutes/grid.475727.4",
26        "@type": "PropertyValue",
27        "description": "UN Department of Economic and Social Affairs Sustainable Development",


27        "description": "UN Department of Economic and Social Affairs Sustainable Development",
28        "propertyID": "https://registry.identifiers.org/registry/grid",
29        "url": "https://grid.ac/institutes/grid.475727.4"
30    },
31    "subjectOf": {
32        "@type": "CreativeWork",
33        "@id": "http://purl.unep.org/sdg/SDGIO_00020173",
34        "url": "http://www.ontobee.org/ontology/SDGIO?iri=http://purl.unep.org/sdg/SDGIO_00020173",
35        "name": "UNSD SDG indicator code:C140c01",
36        "description": "Number of countries making progress ... the oceans and their resources"
37    },
38    "publishingPrinciples": [
39        {
40            "@type": "CreativeWork",
41            "@id": "https://sdgs.un.org/goals/goal14",
42            "url": "https://sdgs.un.org/goals/goal14",
43            "name": "Sustainable Development Goal 14",
44            "description": "Conserve and sustainably use the oceans, seas and marine resources for sustainable development"
45        },
46        {


45        },
46        {
47            "@type": "CreativeWork",
48            "@id": "https://dx.doi.org/10.1038/sdata.2016.18",
49            "url": "https://www.nature.com/articles/sdata201618",
50            "name": "FAIR data principles",
51            "description": "FAIR Principles definition as referenced from: Wilkinson, M. D. et al. The FAIR Guiding Principles for scientific data management and stewardship."
52        }
53    ]
54}
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/sdg/graphs/org.json") as dgraph:
    doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
subjectOf#
Values expected to be one of these types
Event
CreativeWork
Used on these types
Thing
Lets take a look at subjectOf.  In this case we are using subjectOf to express
a connection to a UN SDG.  This, subjectOf, could also be used to connect
documents describing the policy and principles of an organization or additional
metadata for a creative work.  When we look at subjectOf
we can see we are allowed are allowed to use it on any type Thing, but must point
to a CreativeWork or Event.
Note
Recall that in the case of OIH types, the type CourseInstance or EducationEvent are both
subtype of Event.  Given that we can use subjectOf to connect a Thing to these types
as well.  Also, Course is a subtype of CreativeWork, so we are good there too in the
context of the range of subjectOf.   Reference thematic type Training
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/sdg/graphs/org.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Organization",
  "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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/org/x",
    "@type": "Organization",
    "subjectOf": {
        "@id": "http://purl.unep.org/sdg/SDGIO_00020173",
        "@type": "CreativeWork",
        "description": "Number of countries making progress ... the oceans and their resources",
        "name": "UNSD SDG indicator code:C140c01",
        "url": "http://www.ontobee.org/ontology/SDGIO?iri=http://purl.unep.org/sdg/SDGIO_00020173"
    }
}
publishingPrinciples#
Values expected to be one of these types
CreativeWork
URL
Used on these types
CreativeWork
Organization
Person
Lets take a look at publishingPrinciples.  This can be used
to connect CreativeWork, Organization, or Person to either of CreativeWork or URL.  So this
allows us to link a CreativeWork to a policy or principle statement.  This has some very useful


use cases where resources can be grouped based on their connection to those principles and policies.
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/sdg/graphs/org.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Organization",
  "publishingPrinciples": ""
}
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)


print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/org/x",
    "@type": "Organization",
    "publishingPrinciples": [
        {
            "@id": "https://sdgs.un.org/goals/goal14",
            "@type": "CreativeWork",
            "description": "Conserve and sustainably use the oceans, seas and marine resources for sustainable development",
            "name": "Sustainable Development Goal 14",
            "url": "https://sdgs.un.org/goals/goal14"
        },
        {
            "@id": "https://dx.doi.org/10.1038/sdata.2016.18",
            "@type": "CreativeWork",


"@type": "CreativeWork",
            "description": "FAIR Principles definition as referenced from: Wilkinson, M. D. et al. The FAIR Guiding Principles for scientific data management and stewardship.",
            "name": "FAIR data principles",
            "url": "https://www.nature.com/articles/sdata201618"
        }
    ]
}
Sustainable Development Goals#
The following example provides an an approach to connecting
Sustainable Development Goals
(SDGs) could be linked to via subjectOf.
Other potential links could be made to things such
as the UNDRR-ISC Hazard Definition & Classification
As this is a CreateWork, we can now use one more linking property, the
Schema.org citation property.  By comparison, the
publishingPrinciples or
subjectOf
connections carry a bit more semantic meaning.
 1{
 2  "@context": {
 3    "@vocab": "https://schema.org/"
 4  },
 5  "@type": "CreativeWork",
 6  "@id": "https://example.org/id/XYZ",
 7  "name": "Name or title of the document",
 8  "description": "Description of the resource to aid in searching",
 9  "distribution": {
10    "@type": "DataDownload",


9  "distribution": {
10    "@type": "DataDownload",
11    "contentUrl": "https://www.sample-data-repository.org/dataset/472032.tsv",
12    "encodingFormat": "text/tab-separated-values"
13  },
14  "citation": {
15    "@type": "CreativeWork",
16    "@id": "http://purl.unep.org/sdg/SDGIO_00020173",
17    "url": "http://www.ontobee.org/ontology/SDGIO?iri=http://purl.unep.org/sdg/SDGIO_00020173",
18    "name": "UNSD SDG indicator code:C140c01",
19    "description": "Number of countries making progress ... the oceans and their resources"
20  },
21  "maintainer" : {
22     "@type" : "Organization",
23     "@id": "https://ror.org/050bms902",
24     "description": "UN Department of Economic and Social Affairs Sustainable Development"
25  }
26}
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


sys.path.insert(0, parentdir)
from lib import jbutils
with open("../../../odis-in/dataGraphs/thematics/sdg/graphs/doc.json") as dgraph:
    doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
citation#
Values expected to be one of these types
Text
CreativeWork
Used on these types
CreativeWork
Schema.org citation provides a way to link to another creative work.
This property can be pointed to either Text or CreativeWork.  It should also be noted that citation
can only be used on type CreativeWork.
Due to the limit to use on CreateWork only, this example is not seen in the
above examplewhich is of type Organization.


above examplewhich is of type Organization.
The actual semantics of citation is rather vague stating it is a method to
cite or reference another creative work.
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/sdg/graphs/doc.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "citation": ""
}
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)


print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "citation": {
        "@id": "http://purl.unep.org/sdg/SDGIO_00020173",
        "@type": "CreativeWork",
        "description": "Number of countries making progress ... the oceans and their resources",
        "name": "UNSD SDG indicator code:C140c01",
        "url": "http://www.ontobee.org/ontology/SDGIO?iri=http://purl.unep.org/sdg/SDGIO_00020173"
    }
}
Refs#
SDGs
SDG targets
SDG indicators


Datasets#
About#
Datasets
See also
For OIH the focus is on generic documents which can scope reports, data and other resources.
In those cases where the resources being described are of type Dataset you may wish to review
patterns developed for GeoScience Datasets by the ESIP
Science on Schema community.
Datasets#
Documents will include maps, reports,
guidance and other creative works.  Due to this OIH will focus on a generic example
of schema.org/CreativeWork and then provide examples
for more focused creative work examples.
 1{
 2    "@context": {
 3        "@vocab": "https://schema.org/"
 4    },
 5    "@type": "Dataset",
 6    "@id": "https://registry.org/permanentUrlToThisJsonDoc",
 7    "name": "A concise but descriptive name of the dataset",
 8    "description": "An extended, free-text description of what's in the dataset, who created it, and other attributes",
 9    "url": "https://urlToTheDatasetOrLandingPage.org/",
10    "sameAs": [
11        "http://alternativeUrlToTheDatasetOrLandingPage.org"
12    ],


12    ],
13    "license": "This work is licensed under a  Creative Commons Attribution (CC-BY) 4.0 License",
14    "citation": [
15        "Citation to other work relevant to this dataset",
16        "Citation to other work relevant to this dataset",
17        "Citation to other work relevant to this dataset"
18    ],
19    "version": "2021-04-24T06:34:56.000Z",
20    "keywords": [
21        "Keyword 1",
22        "Keyword 2",
23        "Keyword 3"
24    ],
25    "measurementTechnique": "The URL to or text about the methods, technique or technology used to generate this Dataset",
26    "variableMeasured": [
27        {
28            "@type": "PropertyValue",
29            "name": "Name of a variable in the dataset",
30            "description": "Extended description of this variable"
31        },
32        {
33            "@type": "PropertyValue",
34            "name": "Name of a variable in the dataset",
35            "url": "http://ontology.org/uriToSemanticDescriptorOfThisVariable",
36            "description": "Extended description of this variable?"
37        },
38        {


37        },
38        {
39            "@type": "PropertyValue",
40            "name": "SamplingDeviceApertureSurfaceArea",
41            "url": "http://ontology.org/uriToSemanticDescriptorOfThisVariable",
42            "description": "Extended description of this variable"
43        }
44    ],
45    "includedInDataCatalog": {
46        "@id": "https://registryOfCatalogs.org/permanentUrlIdentifiyingCatalog",
47        "@type": "DataCatalog",
48        "url": "https://urlOfDataCatalog.org"
49    },
50    "temporalCoverage": "2007/2007",
51    "distribution": {
52        "@type": "DataDownload",
53        "contentUrl": "http://urlToDirectDownloadOfThisDataset.org/",
54        "encodingFormat": "text/csv"
55    },
56    "spatialCoverage": {
57        "@type": "Place",
58        "geo": {
59            "@type": "GeoShape",
60            "polygon": "142.014 10.161667,142.014 18.033833,147.997833 18.033833,147.997833 10.161667,142.014 10.161667"
61        },
62        "additionalProperty": {


61        },
62        "additionalProperty": {
63            "@type": "PropertyValue",
64            "propertyID": "http://dbpedia.org/resource/Spatial_reference_system",
65            "value": "http://www.w3.org/2003/01/geo/wgs84_pos#lat_long"
66        }
67    },
68    "provider": [
69        {
70            "@type": "Organization",
71            "legalName": "Legal Name of Organisation which generated the dataset",
72            "name": "Other Name of Organisation which generated the dataset",
73            "url": "https://organisationWebsite.org/"
74        }
75    ],
76    "subjectOf": {
77        "@type": "Event",
78        "description": "Describe the event which is the subject of this dataset. For example, a cruise ID.",
79        "name": "Concise and descriptive name of the Event",
80        "potentialAction": {
81            "@type": "Action",
82            "name": "Concise but descriptive name of action that was part of an Event. For example, the name of a CTD cast",
83            "agent": [
84                "Name or permanent ID of person or thing that performed this action",
85                "Name or permanent ID of person or thing that performed this action",


85                "Name or permanent ID of person or thing that performed this action",
86                "Name or permanent ID of person or thing that performed this action"
87            ],
88            "startTime": "2007-03-11T14:45UTC",
89            "endTime": "2007-03-11T15:42UTC",
90            "instrument": {
91                "@type": "Thing",
92                "name": "The name of the instrument used in the action. For example, the specific model of a CTD, a glider, a moored sensor",
93                "url": "http://ontology.org/uriToSemanticDescriptorOfThisInstrument",
94                "description": "Extended description of the sampling instrument"
95            }
96        }
97    }
98}
Demo area  please ignore#
This area is being used to test out a new repository structure where the data graphs,
frames and SHACL shapes are kept in a discrete location.
import warnings
with warnings.catch_warnings():
    warnings.filterwarnings("ignore",category=DeprecationWarning)

import json
from pyld import jsonld
import os, sys
import urllib
import contextlib
devnull = open(os.devnull, 'w')
contextlib.redirect_stderr(devnull)
currentdir = os.path.dirname(os.path.abspath(''))


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

url = "https://raw.githubusercontent.com/iodepo/odis-in/master/dataGraphs/thematics/docs/graphs/map.json"
dgraph = urllib.request.urlopen(url)
doc = json.load(dgraph)
furl = "https://raw.githubusercontent.com/iodepo/odis-in/master/frames/mapFrameID.json"
fgraph = urllib.request.urlopen(furl)
frame = json.load(fgraph)
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "Map",
    "identifier": {
        "@id": "https://doi.org/10.5066/F7VX0DMQ",
        "@type": "PropertyValue",
        "propertyID": "https://registry.identifiers.org/registry/doi",
        "url": "https://doi.org/10.5066/F7VX0DMQ",
        "value": "doi:10.5066/F7VX0DMQ"
    }
}


Keywords and Defined Terms#
About#
This section is looking at how the keywords could be connected
with Defined Terms that point to external vocabularies that follow
a vocabulary publishing patterns like at the W3C
Best Practice Recipes for Publishing RDF Vocabularies.
The pattern breaks down a bit when attempting to connect with things like
the Global Change Master Directory keywords.
This impedance is caused by publishing approaches for the terms that don’t align well with
the above publishing practices.  This does not mean we can not use these terms, rather that
we may find multiple ways to connect them used by the community.  This can result in some
ambiguity in linking in a community.
A person could adapt the pattern to connect things like the Global Change Observing System
or
EARTH SCIENCE > OCEANS > OCEAN CHEMISTRY.  The later of these does have a UUID (6eb3919b-85ce-4988-8b78-9d0018fd8089) but this is not a dereference-able PID.
Note
This topic of keyword linking with DefinedTerms is under review at the Science on Schema
work at ESIP.   Reference Describing a Dataset
for the latest on their recommendations.
Keywords#
The Schema.org keywords property of CreativeWork can point to three different values.
These are: DefinedTerm, Text and URL.


These are: DefinedTerm, Text and URL.
We can see the three different approaches here to defining keywords.  Here, Region X is a classic
text keyword.  The other two are defined as a DefinedTerm.
 1{
 2    "@context": {
 3        "@vocab": "https://schema.org/"
 4    },
 5    "@type": "Map",
 6    "@id": "https://example.org/id/XYZ",
 7    "name": "Name or title of the document",
 8    "description": "Description of the map to aid in searching",
 9    "url": "https://www.sample-data-repository.org/creativework/map.pdf",
10    "identifier": {
11        "@id": "https://doi.org/10.5066/F7VX0DMQ",
12        "@type": "PropertyValue",
13        "propertyID": "https://registry.identifiers.org/registry/doi",
14        "value": "doi:10.5066/F7VX0DMQ",
15        "url": "https://doi.org/10.5066/F7VX0DMQ"
16    },
17    "keywords": [
18        "Region X",
19        {


17    "keywords": [
18        "Region X",
19        {
20            "@id": "http://purl.org/dc/dcmitype/Image",
21            "@type": "DefinedTerm",
22            "inDefinedTermSet": "http://purl.org/dc/terms/DCMIType",
23            "termCode": "Image",
24            "name": "Image"
25        },
26        {
27            "@id": "https://www.wikidata.org/wiki/Q350134",
28            "@type": "URL",
29            "url": "https://www.wikidata.org/wiki/Q350134"
30        }
31    ]
32}
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/terms/graphs/map.json") as dgraph:
    doc = json.load(dgraph)
frame = {


doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Map",
  "keywords": ""
}
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
framed = jsonld.frame(compacted, frame)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Text#
Keywords can be defined as a Text value.  This is the most common approach though
it doesn’t provide some of the benefits of the other two approaches.  For example, it doesn’t allow for terms to
be dereferenced on the net or for connects in the graph to be made for common terms by their subject IRIs.
{


{
  "@context": "https://schema.org/",
  "keywords": [
    "nitrous oxide",
    "Central Pacific",
    "headspace equilibration",
    "SRI Greenhouse Gas Monitoring Gas Chromatograph",
    "CTD profiler",
    "Gas Chromatograph"
  ]
}
Note
Be sure to use the [] notation to define the keyword.  This defined an array of items vs a single items.  If you
use an approach like {“term1, term2, term4”} you have only created a single text string with comma separated values.  However
that is viewed as a single string in the graph.   The [] notation creates an array of strings all connected to the subject IRI
by the property keywords.
URL#
Keywords can also point to a URL.  This provides a way to link to a vocabulary entry that defines the term.  This approach
has some benefits of linking to more details but does easily provide an easy descriptive text for humans.  There is nothing
preventing putting in a text keyword followed up by another entry with a related URL.
DefinedTerm#
This is the most complex approach.  Keywords can point to a DefinedTerm as
defined in a DefinedTermSet pointed to by
the property inDefinedTermSet.  It does offer the ability to present both a human


the property inDefinedTermSet.  It does offer the ability to present both a human
focused textual name and description of the term.  This is a great way to link to a vocabulary entry that defines the term.
It also allows for a URL to be used to link to the vocabulary entry.   While this approach is the most comprehensive, it does
incur a complexity during the query process to extract and present the information.
Defined Terms#
During generation of the structured data a provide may wish to
either use or publish a set of controlled vocabulary terms or
a similar set.
Within schema.org this could be done by leveraging the “DefinedTerm”
amd “DefinedTermSet” types.
These types allow us both to define a set of terms and
use a set of terms in describing a thing.
Note that DefinedTerm is an intangible and can connect to most
types in Schema.org.  So we can use them in places such as:
CreativeWork -> keyword
CreativeWork -> learningResourceType
LearningResource -> teaches  (and many others)
LearningResource -> competencyRequired  (and many others)
PropertyValue -> valueReference
The following example is from the Schema.org DefinedTermSet
reference.
 1[
 2        {
 3                "@context": {
 4                        "@vocab": "https://schema.org/"
 5                }
 6        },


5                }
 6        },
 7        {
 8                "@type": "DefinedTermSet",
 9                "@id": "http://openjurist.org/dictionary/Ballentine",
10                "name": "Ballentine's Law Dictionary",
11                "description": "A description of Ballentine's Law Dictionary Term Set"
12        },
13        {
14                "@type": "DefinedTerm",
15                "@id": "http://openjurist.org/dictionary/Ballentine/term/calendar-year",
16                "name": "calendar year",
17                "description": "The period from January 1st to December 31st, inclusive, of any year.",
18                "inDefinedTermSet": {
19                        "@type": "DefinedTermSet",
20                        "@id": "http://openjurist.org/dictionary/Ballentine"
21                }
22        },
23        {
24                "@type": "DefinedTerm",
25                "@id": "http://openjurist.org/dictionary/Ballentine/term/schema",
26                "name": "schema",
27                "description": "A representation of a plan or theory in the form of an outline or model.",
28                "inDefinedTermSet": {
29                        "@type": "DefinedTermSet",


29                        "@type": "DefinedTermSet",
30                        "@id": "http://openjurist.org/dictionary/Ballentine"
31                }
32        }
33]
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/terms/graphs/map.json") as dgraph:
    doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
References#
schema.org/DefinedTerm
schema.org/DefinedTermSet


Essential Ocean Variables#
This section details initial documentation of approaches for describing elements of a
schema:Dataset with a focus on approaches supporting Essential
Ocean Variables.
A rough description of these links leveraging pseudo schema.org terms follows with a detailed
and valid data graph as an example after that.
Reference image:
The image above details out some of the key points to be encoded.  These include:
Links to and description of methods
QA/QC references
Links to GOOS Specification sheets
Information on variables measured
Connections to the event measured and potential associated instruments
Spatial coverage
Temporal coverage
The valid data graph follows the reference section and details follow that.  The highlighted lines
in the data graph represented the detailed sections.
References:#
GOOS reference
Goos example spec sheet and
OBIS examples
  1{
  2    "@context": {
  3        "@vocab": "https://schema.org/"
  4    },
  5    "@type": "Dataset",
  6    "@id": "https://example.org/dataset/12345",
  7    "name": "Example Vessel Surveys Jan-Apr 2007",


7    "name": "Example Vessel Surveys Jan-Apr 2007",
  8    "description": "Original provider: HDR Environmental, Operations and Construction, Inc. Dataset credits: The U.S. Navy Marine Species Monitoring Program Abstract:Features in this feature class represent sightings from the NAVFAC MISTCS Vessel Surveys Jan-Apr 2007.",
  9    "url": "https://obis.org/dataset/dcbb8f12-c869-4d31-aa8b-23abb27898ce",
 10    "license": "This work is licensed under a  Creative Commons Attribution (CC-BY) 4.0 License",
 11    "citation": "Ampela, K. and G. Miller-Francisco. 2017. MIRC NAVFAC MISTCS Vessel Surveys Jan-Apr 2007. Data downloaded from OBIS-SEAMAP (http://seamap.env.duke.edu/dataset/1519) on yyyy-mm-dd.",
 12    "version": "2021-04-24T06:34:56.000Z",
 13    "keywords": [
 14        "Sea State",
 15        "Mariana Islands Range Complex",
 16        "Oceanography",
 17        "Marine Physics"
 18    ],


17        "Marine Physics"
 18    ],
 19    "variableMeasured": [
 20        {
 21            "@type": "PropertyValue",
 22            "name": "Sea State",
 23            "description": "Sea State is the characterization of wave and swell, typically in terms of height, wavelength, period, and directional wave energy flux ",
 24            "propertyID": [
 25                "http://purl.obolibrary.org/obo/ENVO_01001374",
 26                "https://gcmd.earthdata.nasa.gov/KeywordViewer/scheme/all/11aca777-8a01-42ce-b076-b3059c3d8cae?gtm_keyword=SEA%20STATE&gtm_scheme=Earth%20Science"
 27            ]
 28        },
 29        {
 30            "@type": "PropertyValue",
 31            "name": "Ocean Surface Stress",
 32            "description": "The 2-dimensional horizontal vector Ocean Surface Stress is the rate per unit area at which momentum is transferred from the atmosphere to the ocean.",
 33            "propertyID": "http://purl.obolibrary.org/obo/ENVO_01001844",
 34            "value": 0.2,


34            "value": 0.2,
 35            "unitCode": "http://qudt.org/vocab/unit/N-PER-M2"
 36        }
 37    ],
 38    "measurementTechnique": [
 39        "http://dx.doi.org/10.1002/exampleMethodsSeaStateDOI.ch1",
 40        "http://dx.doi.org/10.1002/exampleMethodsOceanStressDOI.ch1"
 41    ],
 42    "publishingPrinciples": [
 43        {
 44            "@type": "CreativeWork",
 45            "url": "http://www.goosocean.org/components/com_oe/oe.php?task=download&id=34494&version=1.0&lang=1&format=1",
 46            "name": "Ocean Observations Physics and Climate Panel (OOPC) Sea State GOOS EOV Specification Sheet",
 47            "description": "This is the EOV specification sheet released by GOOS for Sea State.  It was composed by the Ocean Observations Panel for Climate.  OOPC is sponsored by the Global Ocean Observing System the Global Climate Observing System and the World Climate Research Program. OOPC provides advice on scientific requirements to the Joint Commission for Oceanography and Marine Meteorology. "
 48        },


48        },
 49        {
 50            "@type": "CreativeWork",
 51            "url": "http://www.goosocean.org/components/com_oe/oe.php?task=download&id=34507&version=1.0&lang=1&format=1",
 52            "name": "Ocean Observations Physics and Climate Panel (OOPC) Ocean Surface Stress GOOS EOV Specification Sheet",
 53            "description": "This is the EOV specification sheet released by GOOS for Ocean Surface Stress.  It was composed by the Ocean Observations Panel for Climate.  OOPC is sponsored by the Global Ocean Observing System the Global Climate Observing System and the World Climate Research Program. OOPC provides advice on scientific requirements to the Joint Commission for Oceanography and Marine Meteorology. "
 54        },
 55        {
 56            "@type": "CreativeWork",
 57            "url": "http://example.org/id/doc/ID",
 58            "name": "QA/QC guidance",


58            "name": "QA/QC guidance",
 59            "description": "QA/QC  - EOV data and the methods used to generate them should have been vetted through some QA/QC methods, ideally performed by an independent third-party. These should be included in a dedicated JSON-LD block, even if it points to the same methodology linked to in the measurementTechnique block. "
 60        }
 61    ],
 62    "distribution": {
 63        "@type": "DataDownload",
 64        "contentUrl": "http://example.org/archive.do?r=zd_1519",
 65        "encodingFormat": "application/zip"
 66    },
 67    "spatialCoverage": {
 68        "@type": "Place",
 69        "geo": {
 70            "@type": "GeoShape",
 71            "polygon": "142.014 10.161667,142.014 18.033833,147.997833 18.033833,147.997833 10.161667,142.014 10.161667"
 72        },
 73        "additionalProperty": {
 74            "@type": "PropertyValue",
 75            "propertyID": "http://dbpedia.org/resource/Spatial_reference_system",


75            "propertyID": "http://dbpedia.org/resource/Spatial_reference_system",
 76            "value": "http://www.w3.org/2003/01/geo/wgs84_pos#lat_long"
 77        }
 78    },
 79    "provider": [
 80        {
 81            "@id": "https://oceanexpert.org/institution/INSTITUTE_ID",
 82            "@type": "Organization",
 83            "legalName": "Example University",
 84            "name": "Example University",
 85            "url": "https://oceanexpert.org/institution/INSTITUTE_ID"
 86        }
 87    ],
 88    "about": {
 89        "@type": "Event",
 90        "description": "describe the activity, might include name here too.",
 91        "name": "Measurement of sea state",
 92        "potentialAction": [
 93            {
 94                "@type": "Action",
 95                "name": "Measurement of sea state",
 96                "instrument": {
 97                    "@type": "Thing",
 98                    "name": "OceanWaveS WaMoS II 500 waves and surface current radar",


99                    "url": "http://vocab.nerc.ac.uk/collection/L22/current/TOOL0999/",
100                    "description": "The WaMoS II 500 radar is an industry-proven X-band radar-based wave and surface current monitoring system developed by OceanWaveS. This sensor is able to measure and displays essential wave field parameters including wave heights, periods, directions and surface currents. The operating range extends to 4.0 km depending on X-band radar type and installation gemoetry. Requiring a minimum wind speed of 3 m/s and a minimum wave height of about 0.5m."
101                }
102            },
103            {
104                "@type": "Action",
105                "name": "Measurement of ocean stress",
106                "instrument": {
107                    "@type": "Thing",
108                    "name": "Metek uSonic-3 Scientific {formerly: USA-1} ultrasonic anemometer",
109                    "url": "http://vocab.nerc.ac.uk/collection/L22/current/TOOL1402/",


110                    "description": "A high precision 3D sonic anemometer. Typical applications for this device include: meteorological systems, meteorological networks, measuring dispersion parameters for pollution modelling, research stations, industrial sites, air quality forecasts, eddy correlation fluxes, marine and offshore platforms, wind shear detection, wind energy, and wake vortex monitoring. This device takes accurate measurement of 3 wind components and turbulence. Constructed with stainless steel. "
111                }
112            }
113        ]
114    },
115    "datePublished": "2018-07-29",
116    "dateModified": "2018-07-30T14:30Z",
117    "temporalCoverage": "2012-09-20/2016-01-22"
118}
license#
As licenses are an important cross-cutting item there is a separate section on licenses
at:  License chapter
keywords#
As keywords are an important cross-cutting item there is a separate section on keywords
at:  Keywords chapter
variableMeasured#
A key section detailing approaches to describing variables.  This property expects either of text or
the more detailed schema:PropertyValue.
Note
There can be multiple links in the proertyID property.  Preference should be given to those with semantic descriptions.
Note


Note
In cases where a single value can be associated with a variable, or a min max value, this can be provided along with a
unitCode property.   In cases where a variable represents a large collection of data this can be omitted and the data obtained
in a distribution reference.
See also
See also:  Science on Schema variable
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/variables/graphs/obisData2.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "Dataset",
  "variableMeasured": ""
}
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
framed = jsonld.frame(compacted, frame)


framed = jsonld.frame(compacted, frame)
jd = json.dumps(framed, indent=4)
print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/dataset/12345",
    "@type": "Dataset",
    "variableMeasured": [
        {
            "@type": "PropertyValue",
            "description": "Sea State is the characterization of wave and swell, typically in terms of height, wavelength, period, and directional wave energy flux ",
            "name": "Sea State",
            "propertyID": [
                "http://purl.obolibrary.org/obo/ENVO_01001374",


"https://gcmd.earthdata.nasa.gov/KeywordViewer/scheme/all/11aca777-8a01-42ce-b076-b3059c3d8cae?gtm_keyword=SEA%20STATE&gtm_scheme=Earth%20Science"
            ]
        },
        {
            "@type": "PropertyValue",
            "description": "The 2-dimensional horizontal vector Ocean Surface Stress is the rate per unit area at which momentum is transferred from the atmosphere to the ocean.",
            "name": "Ocean Surface Stress",
            "propertyID": "http://purl.obolibrary.org/obo/ENVO_01001844",
            "unitCode": "http://qudt.org/vocab/unit/N-PER-M2",
            "value": 0.2
        }
    ]
}
measurementTechnique#
https://schema.org/measurementTechnique is used to provide either
text about or a URL to information about the techniques or technology used in a Dataset.
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)


parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils
with open("../../../odis-in/dataGraphs/thematics/variables/graphs/obisData2.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "Dataset",
  "measurementTechnique": ""
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"


{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/dataset/12345",
    "@type": "Dataset",
    "measurementTechnique": [
        "http://dx.doi.org/10.1002/exampleMethodsSeaStateDOI.ch1",
        "http://dx.doi.org/10.1002/exampleMethodsOceanStressDOI.ch1"
    ]
}
publishingPrinciples#
As defined in the Linking to Principles
section on publishing principles, This can be used to connect CreativeWork, Organization, or Person to either of
CreativeWork or URL. So this allows us to link a CreativeWork to a policy or principle statement.
This has some very useful use cases where resources can be grouped based on their connection to those principles and policies.
For this section on EOVs, it is used to link in the specification sheets for the measured variables.  This can also be used to link
in QA/QC documentation.  There is no direct connection between the creative works linked here and the measured variables though convention
would be to keep the order the same if possible.  Such order is not maintained through potential serialization of the JSON-LD records though
list order can be maintained with an @list keyword.
import json


list order can be maintained with an @list keyword.
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/variables/graphs/obisData2.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "Dataset",
  "publishingPrinciples": ""
}
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)


print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/dataset/12345",
    "@type": "Dataset",
    "publishingPrinciples": [
        {
            "@type": "CreativeWork",
            "description": "This is the EOV specification sheet released by GOOS for Sea State.  It was composed by the Ocean Observations Panel for Climate.  OOPC is sponsored by the Global Ocean Observing System the Global Climate Observing System and the World Climate Research Program. OOPC provides advice on scientific requirements to the Joint Commission for Oceanography and Marine Meteorology. ",
            "name": "Ocean Observations Physics and Climate Panel (OOPC) Sea State GOOS EOV Specification Sheet",


"url": "http://www.goosocean.org/components/com_oe/oe.php?task=download&id=34494&version=1.0&lang=1&format=1"
        },
        {
            "@type": "CreativeWork",
            "description": "This is the EOV specification sheet released by GOOS for Ocean Surface Stress.  It was composed by the Ocean Observations Panel for Climate.  OOPC is sponsored by the Global Ocean Observing System the Global Climate Observing System and the World Climate Research Program. OOPC provides advice on scientific requirements to the Joint Commission for Oceanography and Marine Meteorology. ",
            "name": "Ocean Observations Physics and Climate Panel (OOPC) Ocean Surface Stress GOOS EOV Specification Sheet",
            "url": "http://www.goosocean.org/components/com_oe/oe.php?task=download&id=34507&version=1.0&lang=1&format=1"
        },
        {
            "@type": "CreativeWork",
            "description": "QA/QC  - EOV data and the methods used to generate them should have been vetted through some QA/QC methods, ideally performed by an independent third-party. These should be included in a dedicated JSON-LD block, even if it points to the same methodology linked to in the measurementTechnique block. ",


"name": "QA/QC guidance",
            "url": "http://example.org/id/doc/ID"
        }
    ]
}
spatialCoverage#
More details on spatial elements are found
at:  Spatial Geometry
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/variables/graphs/obisData2.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "Dataset",
  "spatialCoverage": ""
}
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
framed = jsonld.frame(compacted, frame)
jd = json.dumps(framed, indent=4)
print(jd)


jd = json.dumps(framed, indent=4)
print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/dataset/12345",
    "@type": "Dataset",
    "spatialCoverage": {
        "@type": "Place",
        "additionalProperty": {
            "@type": "PropertyValue",
            "propertyID": "http://dbpedia.org/resource/Spatial_reference_system",
            "value": "http://www.w3.org/2003/01/geo/wgs84_pos#lat_long"
        },
        "geo": {
            "@type": "GeoShape",


},
        "geo": {
            "@type": "GeoShape",
            "polygon": "142.014 10.161667,142.014 18.033833,147.997833 18.033833,147.997833 10.161667,142.014 10.161667"
        }
    }
}
about#
This section is an attempt to leverage schema.org to link instrument information.  This is done via the Event type with a
connected Action type.
See also
See also Identifier and Prov subjectOf and inverse about.
schema:about connects the subject matter of the content.
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/variables/graphs/obisData2.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},


frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "Dataset",
  "about": ""
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/dataset/12345",
    "@type": "Dataset",
    "about": {
        "@type": "Event",
        "description": "describe the activity, might include name here too.",


"description": "describe the activity, might include name here too.",
        "name": "Measurement of sea state",
        "potentialAction": [
            {
                "@type": "Action",
                "instrument": {
                    "@type": "Thing",
                    "description": "The WaMoS II 500 radar is an industry-proven X-band radar-based wave and surface current monitoring system developed by OceanWaveS. This sensor is able to measure and displays essential wave field parameters including wave heights, periods, directions and surface currents. The operating range extends to 4.0 km depending on X-band radar type and installation gemoetry. Requiring a minimum wind speed of 3 m/s and a minimum wave height of about 0.5m.",
                    "name": "OceanWaveS WaMoS II 500 waves and surface current radar",
                    "url": "http://vocab.nerc.ac.uk/collection/L22/current/TOOL0999/"
                },
                "name": "Measurement of sea state"
            },
            {
                "@type": "Action",
                "instrument": {
                    "@type": "Thing",


"instrument": {
                    "@type": "Thing",
                    "description": "A high precision 3D sonic anemometer. Typical applications for this device include: meteorological systems, meteorological networks, measuring dispersion parameters for pollution modelling, research stations, industrial sites, air quality forecasts, eddy correlation fluxes, marine and offshore platforms, wind shear detection, wind energy, and wake vortex monitoring. This device takes accurate measurement of 3 wind components and turbulence. Constructed with stainless steel. ",
                    "name": "Metek uSonic-3 Scientific {formerly: USA-1} ultrasonic anemometer",
                    "url": "http://vocab.nerc.ac.uk/collection/L22/current/TOOL1402/"
                },
                "name": "Measurement of ocean stress"
            }
        ]
    }
}
temporalCoverage#
Representation of temporal coverage follows ISO 8601 patterns.  ESIP Science on Schema
as has patterns for Deep Time (geologic time) patterns.
See also
This section is based on the
Science on Schema Temporal Coverage
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


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/variables/graphs/obisData2.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "Dataset",
  "temporalCoverage": ""
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/dataset/12345",
    "@type": "Dataset",
    "temporalCoverage": "2012-09-20/2016-01-22"
}
Science on Schema temporalCoverage#
Example from Science on Schema recommendations:
 1{    "@context": {
 2    "@vocab": "https://schema.org/",
 3    "time": "http://www.w3.org/2006/time#"
 4},
 5
 6"@type": "Dataset",
 7    "description": "Eruptive activity at Mt. St. Helens, Washington, March 1980 - January 1981",
 8    "temporalCoverage": ["1980-03-27T19:36:00/1981-01-03T00:00:00Z",
 9        {
10            "@type": "time:ProperInterval",
11            "time:hasBeginning": {
12                 "@type": "time:Instant",


12                 "@type": "time:Instant",
13                 "time:inXSDDateTimeStamp": "1980-03-27T19:36:00Z"
14             },
15             "time:hasEnd": {
16                "@type": "time:Instant",
17                "time:inXSDDateTimeStamp": "1981-01-03T00:00:00Z"
18             }
19        }]
20}


Spatial Maps#
About#
Map: A map represented by a static file or document
The schema.org type Map only offers one special property beyond
the parent CreativeWork.  That is a mapType which is an
enumeration of types that do not apply to OIH use cases.  However, the use of the
Map typing itself may aid in narrowing search requests later to a specific creative work.
Schema.org type Map is a subtype of CreativeWork. As such, we can all the approaches
described in the Documents section for this type as well.  The use
of type Map would be focused on documenting files such as KML, GeoJSON or others as a
creative work that may be downloaded and used either in a workflow or directly.
A map in this context would be a static file or document of some sort.  Map services like
those described by an OGC Catalogue Service or other GIS service would be described as a
service.  Potential approaches for doing can be seen the service type.
Note
In the current context, schema.org Map typically references maps as a document.
Here we are likely to reference a KML, Shapefile or GeoPackage.  We may wish to then
indicate the type of document it is through a mimetype via encoding.
 1{
 2    "@context": {
 3        "@vocab": "https://schema.org/"
 4    },


3        "@vocab": "https://schema.org/"
 4    },
 5    "@type": "Map",
 6    "@id": "https://example.org/id/XYZ",
 7    "name": "Name or title of the document",
 8    "description": "Description of the map to aid in searching",
 9    "url": "https://www.sample-data-repository.org/creativework/map.pdf",
10    "identifier": {
11        "@id": "https://doi.org/10.5066/F7VX0DMQ",
12        "@type": "PropertyValue",
13        "propertyID": "https://registry.identifiers.org/registry/doi",
14        "value": "doi:10.5066/F7VX0DMQ",
15        "url": "https://doi.org/10.5066/F7VX0DMQ"
16    },
17    "keywords": [
18        {
19            "@id": "http://purl.org/dc/dcmitype/Image",
20            "@type": "DefinedTerm",
21            "inDefinedTermSet": "http://purl.org/dc/terms/DCMIType",
22            "termCode": "Image",
23            "name": "Image"
24        },
25        "Region X",


23            "name": "Image"
24        },
25        "Region X",
26        {
27            "@id": "https://www.wikidata.org/wiki/Q350134",
28            "@type": "URL",
29            "url": "https://www.wikidata.org/wiki/Q350134",
30            "name": "North Atlantic Ocean"
31        }
32    ]
33}
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/docs/graphs/map.json") as dgraph:
    doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document


Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Details: Identifier#
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.
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/docs/graphs/map.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Map",
  "identifier": ""
}
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
framed = jsonld.frame(compacted, frame)


framed = jsonld.frame(compacted, frame)
jd = json.dumps(framed, indent=4)
print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "Map",
    "identifier": {
        "@id": "https://doi.org/10.5066/F7VX0DMQ",
        "@type": "PropertyValue",
        "propertyID": "https://registry.identifiers.org/registry/doi",
        "url": "https://doi.org/10.5066/F7VX0DMQ",
        "value": "doi:10.5066/F7VX0DMQ"
    }
}
Keywords#


}
}
Keywords#
We can see three different approaches here to defining keywords.
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/docs/graphs/map.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "Map",
  "keywords": ""
}
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)


print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "Map",
    "keywords": [
        {
            "@id": "http://purl.org/dc/dcmitype/Image",
            "@type": "DefinedTerm",
            "inDefinedTermSet": "http://purl.org/dc/terms/DCMIType",
            "name": "Image",
            "termCode": "Image"
        },
        "Region X",
        {
            "@id": "https://www.wikidata.org/wiki/Q350134",
            "@type": "URL",
            "name": "North Atlantic Ocean",
            "url": "https://www.wikidata.org/wiki/Q350134"


"url": "https://www.wikidata.org/wiki/Q350134"
        }
    ]
}
References#
For dataset we can use SOS Dataset
OBPS group is using JericoS3 API (ref:  https://www.jerico-ri.eu/)
Traditional knowledge points here
sounds like they use dspace
For other document these are likely going to be some schema:CretiveWork with there being many subtypes we can explore.   See also here Adam Leadbetter’s work at Ocean best practices
This is a great start and perhaps helps to highlight why SHACL shapes are useful
https://irishmarineinstitute.github.io/erddap-lint/
https://github.com/earthcubearchitecture-project418/p419dcatservices/blob/master/CHORDS/DataFeed.jsonld
*EMODnet  (Coner Delaney)
ERDAP also
Are we talking links from schema.org that link to OGC and ERDAP services
Are these methods?
Sounds like may link to external metadata for interop they have developed in the community
NOAA connected as well
Interested in OGC assets
ERDAP data platform


Documents#
About#
Documents: These include datasets, reports or other documents
See also
For OIH the focus is on generic documents which can scope reports, data and other resources.
In those cases where the resources being described are of type Dataset you may wish to review
patterns developed for GeoScience Datasets by the ESIP
Science on Schema community.
Creative works (documents)#
Documents will include maps, reports,
guidance and other creative works.  Due to this OIH will focus on a generic example
of schema.org/CreativeWork and then provide examples
for more focused creative work examples.
 1{
 2  "@context": {
 3    "@vocab": "https://schema.org/"
 4  },
 5  "@type": "CreativeWork",
 6  "@id": "https://example.org/id/XYZ",
 7  "name": "Name or title of the document",
 8  "description": "Description of the creative work to aid in searching",
 9  "url": "https://www.sample-data-repository.org/creativework/report.pdf",
10  "contributor": {
11    "@type": "Organization",
12    "@id": "http://www.foo.org/orgID",
13    "legalName": "Some Institute"
14  },
15  "author": {


14  },
15  "author": {
16    "@id": "https://www.sample-data-repository.org/person/51317",
17    "@type": "Person",
18    "name": "Dr Uta Passow",
19    "givenName": "Uta",
20    "familyName": "Passow",
21    "url": "https://www.sample-data-repository.org/person/51317"
22  },
23  "identifier": {
24    "@id": "https://doi.org/10.5066/F7VX0DMQ",
25    "@type": "PropertyValue",
26    "propertyID": "https://registry.identifiers.org/registry/doi",
27    "value": "doi:10.5066/F7VX0DMQ",
28    "url": "https://doi.org/10.5066/F7VX0DMQ"
29  },
30  "keywords": {
31    "@type": "DefinedTerm",
32    "inDefinedTermSet": {
33      "@type": "DefinedTermSet",
34      "name": "Name of the set",
35      "description": "Description of the set",
36      "url": "url for the set"
37    },


36      "url": "url for the set"
37    },
38    "termCode": "A code that identifies this DefinedTerm within a DefinedTermSet"
39  },
40  "provider": {
41    "@id": "https://www.repositoryB.org",
42    "@type": "Organization",
43    "legalName": "Sample Data Repository Office",
44    "name": "SDRO",
45    "sameAs": "http://www.re3data.org/repository/r3dxxxxxxxxx",
46    "url": "https://www.sample-data-repository.org"
47  },
48  "license": "http://spdx.org/licenses/CC0-1.0",
49  "publisher": {
50    "@id": "https://www.publishingrus.org",
51    "@type": "Organization",
52    "legalName": "Some Institute"
53  }
54}
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/docs/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
context = {


doc = json.load(dgraph)
context = {
    "@vocab": "https://schema.org/",
}
compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
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.
import json
from pyld import jsonld
import os, sys
import urllib
currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
with open("../../../odis-in/dataGraphs/thematics/docs/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},


frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "CreativeWork",
  "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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "identifier": {
        "@id": "https://doi.org/10.5066/F7VX0DMQ",


"@type": "PropertyValue",
        "propertyID": "https://registry.identifiers.org/registry/doi",
        "url": "https://doi.org/10.5066/F7VX0DMQ",
        "value": "doi:10.5066/F7VX0DMQ"
    }
}
Publisher and provider#
Our JSON-LD documents are graphs that can use framing to subset.  In this case
we can look closer at the provider and publisher properties, which are both
of type Organization.
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/docs/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "CreativeWork",
  "provider": {},
  "publisher": {}


"provider": {},
  "publisher": {}
}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "provider": {
        "@id": "https://www.repositoryB.org",
        "@type": "Organization",
        "legalName": "Sample Data Repository Office",
        "name": "SDRO",
        "sameAs": "http://www.re3data.org/repository/r3dxxxxxxxxx",


"url": "https://www.sample-data-repository.org"
    },
    "publisher": {
        "@id": "https://www.publishingrus.org",
        "@type": "Organization",
        "legalName": "Some Institute"
    }
}
Author type Person#
Our JSON-LD documents are graphs that can use framing to subset.  In this
case we can look closer at the author property which points to a type Person.
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/docs/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "CreativeWork",
  "author": ""
}
context = {
    "@vocab": "https://schema.org/",
}


}
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)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "author": {
        "@id": "https://www.sample-data-repository.org/person/51317",
        "@type": "Person",
        "familyName": "Passow",
        "givenName": "Uta",
        "name": "Dr Uta Passow",


"name": "Dr Uta Passow",
        "url": "https://www.sample-data-repository.org/person/51317"
    }
}
License#
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/docs/graphs/creativework.json") as dgraph:
    doc = json.load(dgraph)
frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@type":     "CreativeWork",
  "license": {}
}
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)


print(jd)
jbutils.show_graph(framed)
Fontconfig error: "/etc/fonts/conf.d/30-0-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/60-open-sans.conf", line 1: Extra content at the end of the document
Fontconfig error: "/etc/fonts/conf.d/62-google-crosextra-caladea-fonts.conf", line 1: Extra content at the end of the document
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/XYZ",
    "@type": "CreativeWork",
    "license": "http://spdx.org/licenses/CC0-1.0"
}
License as URL#
{
  "@context": "https://schema.org/",
  "license": "https://creativecommons.org/licenses/by/4.0/"
}
License as CreativeWork#
{
  "@context": "https://schema.org/",
  "license": {
    "@type": "CreativeWork",
    "name": "Creative Commons Attribution 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/"
  }
}
License as SPDX URL#


}
}
License as SPDX URL#
Use a simple URL
SPDX creates URLs for many licenses including those that don’t have URLs
From a source that harvesters can rely on (e.g. use URL to lookup more information about the license)
{
  "@context": "https://schema.org/",
  "license": "https://spdx.org/licenses/CC-BY-4.0"
}
OR, include both the SPDX and the Creative Commons URLs in an array:
{
  "@context": "https://schema.org/",
  "license": ["https://spdx.org/licenses/CC-BY-4.0", "https://creativecommons.org/licenses/by/4.0/"]
}
References#
For dataset we can use SOS Dataset
OBPS group is using JericoS3 API (ref:  https://www.jerico-ri.eu/)
Traditional knowledge points here
sounds like they use dspace
For other document these are likely going to be some schema:CretiveWork with there being many subtypes we can explore.   See also here Adam Leadbetter’s work at Ocean best practices
This is a great start and perhaps helps to highlight why SHACL shapes are useful
https://irishmarineinstitute.github.io/erddap-lint/


https://irishmarineinstitute.github.io/erddap-lint/
https://github.com/earthcubearchitecture-project418/p419dcatservices/blob/master/CHORDS/DataFeed.jsonld
*EMODnet  (Coner Delaney)
ERDAP also
Are we talking links from schema.org that link to OGC and ERDAP services
Are these methods?
Sounds like may link to external metadata for interop they have developed in the community
NOAA connected as well
Interested in OGC assets
ERDAP data platform


Validation#
About#
This section contains some initial work on developing some validation
approaches for OIH.  The focus initially is not on validating approaches with
the full publishing guidance.  Rather the focuses is on the the “info hub” as a
search application and develops validation to support that.
Well Formed JSON-LD#
SDO Validator
Structured data Linter
JSON-LD Playground
Shape Validation#
Initial approach:
Develop a base SHACL document that assess a data graph based on elements needed to support search
SHACL
Leverage SHACL Playground
RDFShape at https://rdfshape.weso.es/ and https://rdfshape.herokuapp.com/
To support this will need an initial data graph to work with.  The type is not
important.  All types will need to satisfy the search needs.
Examples of these needs include:
Have an @id
Have a name
Have a description
Have a Distribution and contentURL
Reference authority


SPARQL#
Introduction#
This notebook will go over some concepts for querying the graph that is generated by the Ocean InfoHub.
The product of the publishing and indexing process is a graph.  This graph follows the W3C Resource Description
Framework (RDF).   RDF is a data model that can be represented in various text encodings.  Among these
is the JSON-LD format we have been using in the publishing process.
Not all graph libraries and databases support JSON-LD yet, so as part of the aggregation process one step
is to simply translate this format into a format that is supported by the graph database.   Typically we
use something n-triples or turtle for this.  There are many tools for translating RDF from one format to another.
We can load the graphs into a graph database and this was documented in the Aggregation section, so we will not
revisit it here.    In this notebook, we will load the graph into a local graph database in the Python library
that also supports the same query language our graph databases use.  This will make the demonstration easier and
allow you to download and run this notebook on your own machine if you wish.  The query language we will use
is SPARQL.
SPARQL#
SPARQL (SPARQL Protocol and RDF Query Language) is the query language that is used to query RDF graphs.  It


is a W3C recommendation documented at SPARQL 1.1 Query Language.
Load a Graph#
For this demonstration we will be using Python to load the graph and do our queries.  However, there are many
languages and libraries for working with graphs and SPARQL.   Also, you can often query a graph using web UIs
infront of your graph database or even with simple direct HTTP requests.  Examples of some of these can be
found in other sections of the OIH documentation.
import rdflib
g = rdflib.Graph()
g.parse("../tooling/notebooks/data/oceanexperts_graph.ttl", format="ttl")
<Graph identifier=N9656cde6c1054a4ba02f9bbcd09d17a8 (<class 'rdflib.graph.Graph'>)>
Let’s define our first query#
This is a simple query that will return all the triples in the graph.   Recall an RDF graph is make of triples defined by a subject, predicate and object.  You can review RDF at the W3C RDF Primer (https://www.w3.org/TR/rdf11-concepts/).  SPARQL allows us to do a type of pattern matching on the graph by defining a pattern we a relooking for.