All Projects → ropensci → jsonld

ropensci / jsonld

Licence: other
R wrapper for jsonld.js JavaScript library

Programming Languages

r
7636 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jsonld

EGRET
An R-package for the analysis of long-term changes in water quality and streamflow, including the water-quality method Weighted Regressions on Time, Discharge, and Season (WRTDS). http://usgs-r.github.io/EGRET/
Stars: ✭ 71 (+108.82%)
Mutual labels:  r-package
insurancerating
R-package for actuarial pricing
Stars: ✭ 40 (+17.65%)
Mutual labels:  r-package
bold
Interface to the Bold Systems barcode webservice
Stars: ✭ 14 (-58.82%)
Mutual labels:  r-package
ropsec
㊙️ Operations security for R developers
Stars: ✭ 27 (-20.59%)
Mutual labels:  r-package
autumn
autumn: Fast, Modern, and Tidy-Friendly Iterative Raking in R.
Stars: ✭ 26 (-23.53%)
Mutual labels:  r-package
essurvey
Download data from the European Social Survey
Stars: ✭ 47 (+38.24%)
Mutual labels:  r-package
prospectr
R package: Misc. Functions for Processing and Sample Selection of Spectroscopic Data
Stars: ✭ 26 (-23.53%)
Mutual labels:  r-package
PostcodesioR
API wrapper around postcodes.io - free UK postcode lookup and geocoder
Stars: ✭ 36 (+5.88%)
Mutual labels:  r-package
vioplot
Development version of vioplot R package (CRAN maintainer)
Stars: ✭ 25 (-26.47%)
Mutual labels:  r-package
nomisr
Access UK official statistics from the Nomis database through R.
Stars: ✭ 30 (-11.76%)
Mutual labels:  r-package
rcppmsgpack
MsgPack Headers for R / msgpack.org[R]
Stars: ✭ 17 (-50%)
Mutual labels:  r-package
rcheatsheet
⛔ ARCHIVED ⛔ A package to create cheatsheets
Stars: ✭ 33 (-2.94%)
Mutual labels:  r-package
ghrecipes
⛔ ARCHIVED ⛔ Provides some helper functions for using the GitHub V4 API
Stars: ✭ 28 (-17.65%)
Mutual labels:  r-package
oai
OAI-PMH R client
Stars: ✭ 13 (-61.76%)
Mutual labels:  r-package
SpatPCA
R Package: Regularized Principal Component Analysis for Spatial Data
Stars: ✭ 16 (-52.94%)
Mutual labels:  r-package
unfurl
Extract rich metadata from URLs
Stars: ✭ 41 (+20.59%)
Mutual labels:  json-ld
JustJson
JSON helper library for Android
Stars: ✭ 15 (-55.88%)
Mutual labels:  json-ld
diffpriv
Easy differential privacy in R
Stars: ✭ 59 (+73.53%)
Mutual labels:  r-package
dirdf
R package: dirdf - Extracts Metadata from Directory and File Names
Stars: ✭ 57 (+67.65%)
Mutual labels:  r-package
stellar
Search your github stars in R
Stars: ✭ 24 (-29.41%)
Mutual labels:  r-package

jsonld

JSON for Linking Data

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status AppVeyor Build Status Coverage Status CRAN_Status_Badge CRAN RStudio mirror downloads Github Stars

JSON-LD is a light-weight syntax for expressing linked data. It is primarily intended for web-based programming environments, interoperable web services and for storing linked data in JSON-based databases. This package provides bindings to the JavaScript library for converting, expanding and compacting JSON-LD documents.

Hello World

Example from https://github.com/digitalbazaar/jsonld.js#quick-examples. Example data:

doc <- '{
  "http://schema.org/name": "Manu Sporny",
  "http://schema.org/url": {"@id": "http://manu.sporny.org/"},
  "http://schema.org/image": {"@id": "http://manu.sporny.org/images/manu.png"}
}'

context <- '{
  "name": "http://schema.org/name",
  "homepage": {"@id": "http://schema.org/url", "@type": "@id"},
  "image": {"@id": "http://schema.org/image", "@type": "@id"}
}'

Compact and expand:

(out <- jsonld_compact(doc, context))
{
  "@context": {
    "name": "http://schema.org/name",
    "homepage": {
      "@id": "http://schema.org/url",
      "@type": "@id"
    },
    "image": {
      "@id": "http://schema.org/image",
      "@type": "@id"
    }
  },
  "image": "http://manu.sporny.org/images/manu.png",
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/"
} 
(expanded <- jsonld_expand(out))
[
  {
    "http://schema.org/url": [
      {
        "@id": "http://manu.sporny.org/"
      }
    ],
    "http://schema.org/image": [
      {
        "@id": "http://manu.sporny.org/images/manu.png"
      }
    ],
    "http://schema.org/name": [
      {
        "@value": "Manu Sporny"
      }
    ]
  }
] 

Convert between JSON and RDF:

cat(nquads <- jsonld_to_rdf(doc))
_:b0 <http://schema.org/image> <http://manu.sporny.org/images/manu.png> .
_:b0 <http://schema.org/name> "Manu Sporny" .
_:b0 <http://schema.org/url> <http://manu.sporny.org/> .
jsonld_from_rdf(nquads)
[
  {
    "@id": "_:b0",
    "http://schema.org/image": [
      {
        "@id": "http://manu.sporny.org/images/manu.png"
      }
    ],
    "http://schema.org/name": [
      {
        "@value": "Manu Sporny"
      }
    ],
    "http://schema.org/url": [
      {
        "@id": "http://manu.sporny.org/"
      }
    ]
  }
] 

Other utilities:

jsonld_flatten(doc)
[
  {
    "@id": "_:b0",
    "http://schema.org/image": [
      {
        "@id": "http://manu.sporny.org/images/manu.png"
      }
    ],
    "http://schema.org/name": [
      {
        "@value": "Manu Sporny"
      }
    ],
    "http://schema.org/url": [
      {
        "@id": "http://manu.sporny.org/"
      }
    ]
  }
] 
cat(jsonld_normalize(doc, algorithm = 'URDNA2015', format = 'application/nquads'))
_:c14n0 <http://schema.org/image> <http://manu.sporny.org/images/manu.png> .
_:c14n0 <http://schema.org/name> "Manu Sporny" .
_:c14n0 <http://schema.org/url> <http://manu.sporny.org/> .
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].