Skip to content

JSON-LD not compliance with the standard #40

@sandroacoelho

Description

@sandroacoelho

Hi @m1ci , @jnehring

Our current JSON-LD produced by FREME Common Module is not fully compliance with the standard. The problems are:

1. Context should be just an URL that represents all ontologies that @graph collection have;

2. NIF and RDF ontologies are not fully mapped in context;

3. Some properties are not mapped in JSONLD-playground (E.g: itsrdf:taConfidence and nif:anchorOf). If it happens, you will lose data when you convert to flattened, compacted, framed or n-quads format ;

We can fix all of points above as follow:

1. Use the service http://jsonld-context.io/ to produce our context directly

{
"@context": "http://www.jsonld-context.io/api/v1?ontology=http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core&ontology=http://www.w3.org/2005/11/its/rdf",
}

OR store / distribute it using a static file under www.freme-project.eu

{
"@context": "http://www.freme-project.eu/context.jsonld",
}

2. The service http://jsonld-context.io/ reads any ontology and produces a complete context. We don't need to care about it

3. All keys in JSON-LD must be produced without prefixes. The context is responsible for assign the respective prefixes on it

E.g

{
	"@context": "http://www.jsonld-context.io/api/v1?ontology=http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core&ontology=http://www.w3.org/2005/11/its/rdf",
	"@graph": [{
		"@id": "b4ac3c64c1ac9b5d3178d2ec3ba101c7",
		"@type": ["Context", "OffsetBasedString"],
		"beginIndex": 0,
		"endIndex": 33,
		"isString": "Diego Maradona is from Argentina."
	}, {
		"@id": "b4a3fc77148b17cd21face1c1169353f",
		"@type": "Annotation",
		"taAnnotatorsRef": "http://freme-project.eu/tools/freme-ner",
		"taClassRef": ["http://dbpedia.org/ontology/Place", "http://dbpedia.org/ontology/Location", "http://dbpedia.org/ontology/PopulatedPlace", "http://nerd.eurecom.fr/ontology#Location", "http://dbpedia.org/ontology/Country"],
		"taConfidence": 0.9804963628413852,
		"taIdentRef": "http://dbpedia.org/resource/Argentina",
		"referenceContext": "b4ac3c64c1ac9b5d3178d2ec3ba101c7"
	}, {
		"@id": "ca6e4dcf014c81a0ced8b01d849a29c9",
		"@type": "Annotation",
		"taAnnotatorsRef": "http://freme-project.eu/tools/freme-ner",
		"taClassRef": ["http://dbpedia.org/ontology/Person", "http://dbpedia.org/ontology/SportsManager", "http://dbpedia.org/ontology/SoccerManager", "http://nerd.eurecom.fr/ontology#Person"],
		"taConfidence": 0.9869992701528016,
		"taIdentRef": "http://dbpedia.org/resource/Diego_Maradona",
		"referenceContext": "b4ac3c64c1ac9b5d3178d2ec3ba101c7",
		"taMsClassRef": ["http://dbpedia.org/ontology/SoccerManager"]
	}]
}

Best,

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions