Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON-LD context inconsistencies - towards a single .jsonld file #127

Open
joepio opened this issue Mar 23, 2017 · 4 comments
Open

JSON-LD context inconsistencies - towards a single .jsonld file #127

joepio opened this issue Mar 23, 2017 · 4 comments

Comments

@joepio
Copy link

joepio commented Mar 23, 2017

We are working a project with an API that returns meetings with related motions and vote events from various Dutch municipalities. We want to add @context to our JSON responses, but currently, the popolo JSON-LD files are scoped for each individual class. For example, the parent attribute in an Organization refers to a schema:subOrganizationOf, while the parent of an Event is a schema:superEvent. If we were to combine these .jsonld files, one of the parent attributes would be incorrectly interpreted.

This could be prevented if popolo would have a single .jsonld file with a slightly adjusted mapping.

How do you feel about this? Is there a different way to deal with this problem, except for creating our own mapping by doing something different from popolo?

@jpmckinney
Copy link
Member

JSON-LD is working on allowing @context to be scoped to @type which I believe will resolve the issue, so that you won't end up with conflicting mappings: json-ld/json-ld.org#415

@joepio
Copy link
Author

joepio commented Apr 12, 2017

That's a good suggestion, James. However, it is not supported by most parsers or serializers which limits the applicability. I still believe that having a single (generated) context file would be far easier to implement for developers.

I generated a single JSONLD context file using the popolo ontology and the owl2jsonld library.

It still needs some work, but would you accept a pull request for a single context file? It could be extremely useful for those who want to create a dynamic serializer for JSON-LD popolo data. Note, however, that while the used namespaces are the same as in popolo, the shortnames differ.

@jpmckinney
Copy link
Member

jpmckinney commented May 11, 2017

@joepsz Sorry for the delay! I had a quick look at your context file. How did you resolve the property-name conflict issue? I couldn't find a mapping to subOrganizationOf. Did you omit properties that would conflict? But to answer your question, yes, I would consider merging a single context file.

@joepio
Copy link
Author

joepio commented May 23, 2017

@jpmckinney The previous JSONLD was incomplete since the subOrganizationOf property was still missing in the ontology. It's still a work in progress. We'll use the context internally and test it before I'll make a pull request.

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

No branches or pull requests

2 participants