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.

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

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


with open("../../../odis-in/dataGraphs/thematics/projects/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",
        "PropertyValue"
    ],
    "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://dio.org/id/XYZ",
        "https://www.example-data-repository.org"
    ]
}
../../_images/637f938d5a33c0a1c5b0f3fbdb2b1c53680b1456f26608b686c99e54a3ad00b8.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.

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

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

with open("../../../odis-in/dataGraphs/thematics/projects/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",
        "PropertyValue"
    ],
    "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/81bb988acd887a9d04fd1cf8ce1745347fd7e59adbbcb14f6032041ef73249d7.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    "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        {
 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": {
 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",
110      "streetAddress": "234 Main St.",
111      "addressLocality": "Anytown",
112      "addressRegion": "ST",
113      "postalCode": "12345",
114      "addressCountry": "USA"
115    }
116  }
117}
Hide code cell source
import json
from pyld import jsonld
import os, sys

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

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

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

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

References#