Skip to content

Instantly share code, notes, and snippets.

@fils
Created November 5, 2015 12:01
Show Gist options
  • Select an option

  • Save fils/a6b81747b3d16bd8f7ba to your computer and use it in GitHub Desktop.

Select an option

Save fils/a6b81747b3d16bd8f7ba to your computer and use it in GitHub Desktop.
Example LiPD JOSN-LD package. This uses the pattern described at https://www.authorea.com/users/17200/articles/19163/_show_article .
Display the source blob
Display the rendered blob
Raw
{
"@context": {
"Feature": "geojson:Feature",
"FeatureCollection": "geojson:FeatureCollection",
"GeometryCollection": "geojson:GeometryCollection",
"Journal": "http://purl.org/ontology/bibo/Journal",
"LineString": "geojson:LineString",
"MultiLineString": "geojson:MultiLineString",
"MultiPoint": "geojson:MultiPoint",
"MultiPolygon": "geojson:MultiPolygon",
"Person": "http://xmlns.com/foaf/0.1/Person",
"Point": "geojson:Point",
"Polygon": "geojson:Polygon",
"agency": "lipd:fundingAgency",
"archiveModel": "lipd:archiveModel",
"archiveType": "lipd:archiveType",
"article": "http://purl.org/ontology/bibo/Article",
"author": {
"@container": "@set",
"@id": "http://purl.org/dc/elements/1.1/creator"
},
"basis": "lipd:interpretationBasis",
"bbox": {
"@container": "@list",
"@id": "geojson:bbox"
},
"calibration": {
"@container": "@list",
"@id": "lipd:calibration"
},
"climateInterpretation": {
"@container": "@list",
"@id": "lipd:climateInterpretation"
},
"climateParameter": "lipd:climateParameter",
"climateParameterDetail": "lipd:climateParameterDetail",
"columns": {
"@container": "@set",
"@id": "csvw:Column"
},
"coordinates": {
"@id": "geojson:coordinates"
},
"csvw": "http://www.w3.org/ns/csvw#",
"dataDOI": "https://www.datacite.org/",
"dataSetName": "purl:Title",
"datatype": {
"@id": "csvw:datatype",
"@type": "@id"
},
"description": "purl:description",
"doi": {
"@container": "@set",
"@id": "http://purl.org/ontology/bibo/doi"
},
"equation": "lipd:calibrationEquation",
"features": {
"@container": "@set",
"@id": "geojson:coordinates"
},
"filename": "schema:contentUrl",
"funding": {
"@container": "@set",
"@id": "lipd:funding"
},
"geo": {
"@container": "@list",
"@id": "geojson:Feature"
},
"geojson": "http://ld.geojson.org/vocab#",
"geometry": "geojson:geometry",
"grant": "lipd:fundingGrant",
"header": "csvw:header",
"id": "@id",
"inferredMaterial": "lipd:inferredMaterial",
"instrument": "schema:instrument",
"interpDirection": "lipd:interpDirection",
"investigators": "purl:Creator",
"issue": "http://purl.org/ontology/bibo/issue",
"journal": "http://purl.org/dc/elements/1.1/isPartOf",
"link": {
"@container": "@set",
"@id": "http://purl.org/dc/elements/1.1/link"
},
"lipd": "http://lipd.net/",
"measuredMaterial": "lipd:measuredMaterial",
"method": "lipd:method",
"name": "http://www.w3.org/2000/01/rdf-schema#label",
"notes": "csvw:note",
"number": "csvw:number",
"observationModel": "lipd:observationModel",
"pageEnd": "http://purl.org/ontology/bibo/pageEnd",
"pageStart": "http://purl.org/ontology/bibo/pageStart",
"paleoData": {
"@container": "@set",
"@id": "csvw:Table"
},
"paleoDataTableName": "purl:Title",
"parameter": "csvw:name",
"parameterType": "lipd:parameterType",
"properties": "geojson:properties",
"proxy": "lipd:proxy",
"proxySystemModel": {
"@container": "@list",
"@id": "lipd:PSM"
},
"pub": {
"@container": "@list",
"@id": "http://okfnlabs.org/bibjson/"
},
"pubYear": "http://purl.org/dc/elements/1.1/date",
"purl": "http://purl.org/dc/terms/",
"reference": "lipd:calibrationReference",
"schema": "http://schema.org/",
"seasonality": "lipd:seasonality",
"sensorModel": "lipd:sensorModel",
"standard": "purl:Standard",
"title": "http://purl.org/dc/elements/1.1/title",
"type": "@type",
"uncertainty": "lipd:calibrationUncertainty",
"uncertaintyType": "lipd:calibrationUncertaintyType",
"units": "schema:units",
"version": "schema:version",
"volume": "http://purl.org/ontology/bibo/volume",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"archiveType": "Marine Sediments",
"dataDOI": null,
"dataSetName": "RAPiD-12-1K.Thornalley.2009",
"features": [
{
"geometry": {
"coordinates": [
-17.82,
62.08,
-1938
],
"type": "Point"
},
"properties": {
"siteName": "RAPiD-12-1K, South Iceland Rise, northeast North Atlantic"
},
"type": "Feature"
}
],
"funding": [
{
"agency": "NERC",
"grant": "Rapid Climate Change programme"
}
],
"investigators": "Thornalley, D.J.R; Elderfield, H.; McCave, N",
"paleoData": [
{
"columns": [
{
"datatype": "csvw:NumericFormat",
"description": "depth below ocean floor",
"notes": "depth refers to top of sample",
"number": 1,
"parameter": "depth",
"parameterType": "measured",
"units": "cm"
},
{
"datatype": "csvw:NumericFormat",
"description": "calendar year AD",
"method": "linear interpolation",
"number": 2,
"parameter": "year",
"parameterType": "inferred",
"units": " AD"
},
{
"calibration": {
"equation": "BAR2005: Mg/Ca=0.794*exp(0.10*SST)",
"reference": "Barker et al., (2005), Thornalley et al., (2009)",
"uncertainty": 1.3
},
"climateInterpretation": {
"basis": "Mg/Ca calibration to SST",
"interpDirection": "positive",
"parameter": "T",
"parameterDetail": "seaSurface",
"seasonality": "MJJ"
},
"datatype": "csvw:NumericFormat",
"description": "sea-surface temperature inferred from Mg/Ca ratios",
"material": "foramifera carbonate",
"number": 3,
"parameter": "temperature",
"parameterType": "inferred",
"proxy": "Mg/Ca",
"units": "deg C"
}
],
"filename": "Atlantic0220Thornalley2009.csv",
"paleoDataTableName": "data"
}
],
"pub": {
"author": [
{
"name": "Thornalley, D.J.R"
},
{
"name": "Elderfield, H."
},
{
"name": "McCave, N"
}
],
"identifier": [
{
"id": "10.1038/nature07717",
"type": "doi",
"url": "http://dx.doi.org/10.1038/nature07717"
}
],
"pubYear": 2009,
"type": "article"
},
"type": "FeatureCollection",
"version": "1.0.0"
}
@fils
Copy link
Author

fils commented Nov 5, 2015

It's worth noting that this JSON-LD also contains a GeoJSON aspect. Which github detects and attempts to render as a map. Select the "source" blob view to see the body. This text also correctly parses as JSON-LD via linters like http://json-ld.org/playground/ and http://www.markus-lanthaler.com/jsonld/playground/ as well as GeoJSON linters such as http://geojsonlint.com/ .

This means this data can be quickly cast to RDF, or other structured formats and also easily machine parsed in workflows.

@fils
Copy link
Author

fils commented Nov 5, 2015

Another note....
Given this is JSON-LD, the rather large context aspect can be removed from the rest of the body and linked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment