All Projects → piprate → Json Gold

piprate / Json Gold

Licence: apache-2.0
A JSON-LD processor for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Json Gold

titanium-json-ld
A JSON-LD 1.1 Processor & API
Stars: ✭ 79 (-35.25%)
Mutual labels:  linked-data, json-ld
CASE
Cyber-investigation Analysis Standard Expression (CASE) Ontology
Stars: ✭ 46 (-62.3%)
Mutual labels:  linked-data, json-ld
YALC
🕸 YALC: Yet Another LOD Cloud (registry of Linked Open Datasets).
Stars: ✭ 14 (-88.52%)
Mutual labels:  linked-data, json-ld
Jsonld.js
A JSON-LD Processor and API implementation in JavaScript
Stars: ✭ 1,212 (+893.44%)
Mutual labels:  linked-data, json-ld
Rdf Ext
RDF library for NodeJS and the Browsers
Stars: ✭ 97 (-20.49%)
Mutual labels:  linked-data, json-ld
jsonld-context-parser.js
Parses JSON-LD contexts
Stars: ✭ 20 (-83.61%)
Mutual labels:  linked-data, json-ld
Senpy
A sentiment and emotion analysis server in Python
Stars: ✭ 67 (-45.08%)
Mutual labels:  linked-data, json-ld
ControlledVocabularyManager
Rails application with Blazegraph for managing controlled vocabularies in RDF.
Stars: ✭ 20 (-83.61%)
Mutual labels:  linked-data, json-ld
Hypergraphql
GraphQL interface for querying and serving linked data on the Web.
Stars: ✭ 112 (-8.2%)
Mutual labels:  linked-data, json-ld
Schema Dts
JSON-LD TypeScript types for Schema.org vocabulary
Stars: ✭ 338 (+177.05%)
Mutual labels:  linked-data, json-ld
Terminusdb
Open source graph database and document store. Designed for collaboratively building data-intensive applications and knowledge graphs.
Stars: ✭ 1,250 (+924.59%)
Mutual labels:  linked-data, json-ld
Pyld
JSON-LD processor written in Python
Stars: ✭ 413 (+238.52%)
Mutual labels:  linked-data, json-ld
Rdflib
RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
Stars: ✭ 1,584 (+1198.36%)
Mutual labels:  linked-data, json-ld
twinql
A graph query language for the semantic web
Stars: ✭ 17 (-86.07%)
Mutual labels:  linked-data, json-ld
sparql-transformer
A more handy way to use SPARQL data in your web app
Stars: ✭ 38 (-68.85%)
Mutual labels:  linked-data, json-ld
jsonld-streaming-serializer.js
A fast and lightweight streaming JSON-LD serializer for JavaScript
Stars: ✭ 20 (-83.61%)
Mutual labels:  linked-data, json-ld
Php Json Ld
PHP implementation of a JSON-LD Processor and API
Stars: ✭ 246 (+101.64%)
Mutual labels:  linked-data, json-ld
Jsonld
JSON-LD processor for PHP
Stars: ✭ 280 (+129.51%)
Mutual labels:  linked-data, json-ld
Activity
ActivityStreams & ActivityPub in golang, oh my!
Stars: ✭ 373 (+205.74%)
Mutual labels:  linked-data, json-ld
Hypergraphql
GraphQL interface for querying and serving linked data on the Web.
Stars: ✭ 120 (-1.64%)
Mutual labels:  linked-data, json-ld

JSON-goLD Documentations Travis CI results

This library is an implementation of the JSON-LD 1.1 specification in Go. It supports both URDNA2015 and URGNA2012 RDF dataset normalisation algorithms.

Conformance

This library aims to pass the official test suite and conform with the following:

Current JSON-LD 1.1 Conformance Status

This library provides comprehensive support of JSON-LD 1.1 specification, except in the areas mentioned below:

Expansion

Good coverage.

Compaction

Good coverage, except:

  • @included directive not supported

RDF Serialization/Deserialization

Good coverage, except:

  • partial support for JSON literals (@json)
  • rdfDirection option is not yet supported (including i18n-datatype and compound-literal forms)

HTML based processing

Not supported.

Current JSON-LD 1.1 Framing Conformance Status

Not supported. The current implementation is still based on an earlier version of JSON-LD 1.1 Framing specification.

Official 1.1 Test Suite

As of April 4th, 2020:

Examples

Expand

See complete code in examples/expand.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")

// expanding remote document

expanded, err := proc.Expand("http://json-ld.org/test-suite/tests/expand-0002-in.jsonld", options)
if err != nil {
	log.Println("Error when expanding JSON-LD document:", err)
	return
}

// expanding in-memory document

doc := map[string]interface{}{
	"@context": "http://schema.org/",
	"@type": "Person",
	"name": "Jane Doe",
	"jobTitle": "Professor",
	"telephone": "(425) 123-4567",
	"url": "http://www.janedoe.com",
}

expanded, err = proc.Expand(doc, options)

Compact

See complete code in examples/compact.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")

doc := map[string]interface{}{
	"@id": "http://example.org/test#book",
	"http://example.org/vocab#contains": map[string]interface{}{
		"@id": "http://example.org/test#chapter",
	},
	"http://purl.org/dc/elements/1.1/title": "Title",
}

context := map[string]interface{}{
	"@context": map[string]interface{}{
		"dc": "http://purl.org/dc/elements/1.1/",
		"ex": "http://example.org/vocab#",
		"ex:contains": map[string]interface{}{
			"@type": "@id",
		},
	},
}

compactedDoc, err := proc.Compact(doc, context, options)

Flatten

See complete code in examples/flatten.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")

doc := map[string]interface{}{
	"@context": []interface{}{
		map[string]interface{}{
			"name": "http://xmlns.com/foaf/0.1/name",
			"homepage": map[string]interface{}{
				"@id": "http://xmlns.com/foaf/0.1/homepage",
				"@type": "@id",
			},
		},
		map[string]interface{}{
			"ical": "http://www.w3.org/2002/12/cal/ical#",
		},
	},
	"@id": "http://example.com/speakers#Alice",
	"name": "Alice",
	"homepage": "http://xkcd.com/177/",
	"ical:summary": "Alice Talk",
	"ical:location": "Lyon Convention Centre, Lyon, France",
}

flattenedDoc, err := proc.Flatten(doc, nil, options)

Frame

See complete code in examples/frame.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")

doc := map[string]interface{}{
	"@context": map[string]interface{}{
		"dc": "http://purl.org/dc/elements/1.1/",
		"ex": "http://example.org/vocab#",
		"ex:contains": map[string]interface{}{"@type": "@id"},
	},
	"@graph": []interface{}{
		map[string]interface{}{
			"@id": "http://example.org/test/#library",
			"@type": "ex:Library",
			"ex:contains": "http://example.org/test#book",
		},
		map[string]interface{}{
			"@id": "http://example.org/test#book",
			"@type": "ex:Book",
			"dc:contributor": "Writer",
			"dc:title": "My Book",
			"ex:contains": "http://example.org/test#chapter",
		},
		map[string]interface{}{
			"@id": "http://example.org/test#chapter",
			"@type": "ex:Chapter",
			"dc:description": "Fun",
			"dc:title": "Chapter One",
		},
	},
}

frame := map[string]interface{}{
	"@context": map[string]interface{}{
		"dc": "http://purl.org/dc/elements/1.1/",
		"ex": "http://example.org/vocab#",
	},
	"@type": "ex:Library",
	"ex:contains": map[string]interface{}{
		"@type": "ex:Book",
		"ex:contains": map[string]interface{}{
			"@type": "ex:Chapter",
		},
	},
}

framedDoc, err := proc.Frame(doc, frame, options)

To RDF

See complete code in examples/to_rdf.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")
options.Format = "application/n-quads"

// this JSON-LD document was taken from http://json-ld.org/test-suite/tests/toRdf-0028-in.jsonld
doc := map[string]interface{}{
	"@context": map[string]interface{}{
		"sec":        "http://purl.org/security#",
		"xsd":        "http://www.w3.org/2001/XMLSchema#",
		"rdf":        "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
		"dc":         "http://purl.org/dc/terms/",
		"sec:signer": map[string]interface{}{"@type": "@id"},
		"dc:created": map[string]interface{}{"@type": "xsd:dateTime"},
	},
	"@id":                "http://example.org/sig1",
	"@type":              []interface{}{"rdf:Graph", "sec:SignedGraph"},
	"dc:created":         "2011-09-23T20:21:34Z",
	"sec:signer":         "http://payswarm.example.com/i/john/keys/5",
	"sec:signatureValue": "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=",
	"@graph": map[string]interface{}{
		"@id":      "http://example.org/fact1",
		"dc:title": "Hello World!",
	},
}
triples, err := proc.ToRDF(doc, options)

From RDF

See complete code in examples/from_rdf.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")

triples := `
	<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
	<http://example.com/Subj1> <http://example.com/prop1> <http://example.com/Obj1> .
	<http://example.com/Subj1> <http://example.com/prop2> "Plain" .
	<http://example.com/Subj1> <http://example.com/prop2> "2012-05-12"^^<http://www.w3.org/2001/XMLSchema#date> .
	<http://example.com/Subj1> <http://example.com/prop2> "English"@en .
`

doc, err := proc.FromRDF(triples, options)

Normalize

See complete code in examples/normalize.go.

proc := ld.NewJsonLdProcessor()
options := ld.NewJsonLdOptions("")
options.Format = "application/n-quads"
options.Algorithm = "URDNA2015"

doc := map[string]interface{}{
	"@context": map[string]interface{}{
		"ex": "http://example.org/vocab#",
	},
	"@id": "http://example.org/test#example",
	"@type": "ex:Foo",
	"ex:embed": map[string]interface{}{
		"@type": "ex:Bar",
	},
}

normalizedTriples, err := proc.Normalize(doc, options)

Inspiration

This implementation was influenced by Ruby JSON-LD reader/writer, JSONLD-Java with some techniques borrowed from PyLD and gojsonld. Big thank you to the contributors of the aforementioned libraries for figuring out implementation details of the core algorithms.

History

The original library was written by Stan Nazarenko (@kazarena). See the full list of contributors here.

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].