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.

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": {
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

with open("./graphs/doc.json") as dgraph:

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

compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)


citation#

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.

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("./graphs/doc.json") as 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)

{
"@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"
}
}