Projects

About

Project: An enterprise (potentially individual but typically collaborative), planned to achieve a particular aim. Use properties from Organization, subOrganization/parentOrganization to indicate project sub-structures.

Research Project

This is what a basic research project data graph might look like. We have the full record below, but this shows some of the basics we would be looking for.

This type is based on the Schema.org type Project which has a sub-type of ResearchProject.

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/proj.json") as dgraph:
    doc = json.load(dgraph)

frame = {
  "@context": {"@vocab": "https://schema.org/"},
  "@explicit": "true",
  "@requireAll": "true",
  "@type":     "ResearchProject",
  "legalName": "",
  "name": "",
  "url": "",
  "description": "",
  "identifier": {} 
}

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

compacted = jsonld.compact(doc, context)

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

jbutils.show_graph(framed)
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/resproj/X",
    "@type": "ResearchProject",
    "description": "Repo description ... ",
    "identifier": {
        "@id": "https://grid.ac/institutes/grid.475727.4",
        "@type": "PropertyValue",
        "description": "UN Department of Economic and Social Affairs Sustainable Development",
        "propertyID": "https://registry.identifiers.org/registry/grid",
        "url": "https://grid.ac/institutes/grid.475727.4"
    },
    "legalName": "Example Data Repository",
    "name": "ExDaRepo",
    "url": "https://www.example-data-repository.org"
}
../../_images/README_1_1.svg

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("./graphs/proj.json") as dgraph:
    doc = json.load(dgraph)

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

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

compacted = jsonld.compact(doc, context)

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

jbutils.show_graph(framed)
{
    "@context": {
        "@vocab": "https://schema.org/"
    },
    "@id": "https://example.org/id/resproj/X",
    "@type": "ResearchProject",
    "identifier": {
        "@id": "https://grid.ac/institutes/grid.475727.4",
        "@type": "PropertyValue",
        "description": "UN Department of Economic and Social Affairs Sustainable Development",
        "propertyID": "https://registry.identifiers.org/registry/grid",
        "url": "https://grid.ac/institutes/grid.475727.4"
    }
}
../../_images/README_3_12.svg

Full Research Project

Here is what our full record looks like. We have added in several more nodes to cover things like funding source, policy connections, spatial area served and parent organization.

 1{
 2  "@context": {
 3    "@vocab": "https://schema.org/"
 4  },
 5  "@type":     "ResearchProject",
 6  "@id": "https://example.org/id/resproj/X",
 7  "legalName": "Example Data Repository",
 8  "name": "ExDaRepo",
 9  "url": "https://www.example-data-repository.org",
10  "description": "Repo description ... ",
11  "logo": {
12    "@type": "ImageObject",
13    "url": "https://www.example-data-repository.org/logo.jpg"
14  },
15  "identifier": {
16    "@id": "https://grid.ac/institutes/grid.475727.4",
17    "@type": "PropertyValue",
18    "description": "UN Department of Economic and Social Affairs Sustainable Development",
19    "propertyID": "https://registry.identifiers.org/registry/grid",
20    "url": "https://grid.ac/institutes/grid.475727.4"
21  },
22  "contactPoint": {
23    "@id": "https://www.example-data-repository.org/about-us",
24    "@type": "ContactPoint",
25    "name": "Support",
26    "email": "info@example-data-repository.org",
27    "url": "https://www.example-data-repository.org/about-us",
28    "contactType": "customer support"
29  },
30  "funder": {
31    "@type": "FundingAgency",
32    "@id": "https://dx.doi.org/10.13039/10000001",
33    "legalName": "National Science Foundation",
34    "alternateName": "NSF",
35    "url": "https://www.nsf.gov/"
36  },
37  "ethicsPolicy": {
38    "@type": "CreativeWork",
39    "@id": "https://example.org/id/XYZ",
40    "name": "Name or title of the document",
41    "description": "Description of the creative work ",
42    "url": "https://www.foo.org/creativework/ethicsPolicy.pdf"
43  },
44  "diversityPolicy": {
45    "@type": "CreativeWork",
46    "@id": "https://example.org/id/ABC",
47    "name": "Name or title of the document",
48    "description": "Description of the creative work",
49    "url": "https://www.foo.org/creativework/diversityPolicy.pdf"
50  },
51  "areaServed": [
52    {
53      "@type": "Place",
54      "geo": {
55        "@type": "GeoCoordinates",
56        "latitude": 39.3280,
57        "longitude": 120.1633
58      },
59      "description": "Description of the area served"
60    },
61    {
62      "@type": "Text",
63      "description": "Textual description of area served"
64    },
65    {
66      "@type": "AdministrativeArea",
67      "geo": {
68        "@type": "GeoCoordinates",
69        "latitude": 39.3280,
70        "longitude": 120.1633
71      },
72      "description": "Needs to be subset of Place, Review Place"
73    }
74  ],
75  "parentOrganization": {
76    "@type": "Organization",
77    "@id": "http://www.someinstitute.edu",
78    "legalName": "Some Institute",
79    "name": "SI",
80    "url": "http://www.someinstitute.edu",
81    "address": {
82      "@type": "PostalAddress",
83      "streetAddress": "234 Main St.",
84      "addressLocality": "Anytown",
85      "addressRegion": "ST",
86      "postalCode": "12345",
87      "addressCountry": "USA"
88    }
89  }
90}
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/proj.json") as dgraph:
    doc = json.load(dgraph)

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

compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)
../../_images/README_5_0.svg