json-ld / json-ld.org

JSON for Linked Data's documentation and playground site
https://json-ld.org/
Other
855 stars 152 forks source link

is there a working json-ld client supporting 1.1 for testing? #504

Closed newgene closed 4 years ago

newgene commented 7 years ago

Hello, there are many great features have been implemented in the coming JSON-LD 1.1 specs. Is there any json-ld client (js, python?) available with even partial support of these hot new 1.1 features? I'm particularly interested in the "scoped context (#247)" and "term-level @vocab (#369)" features.

Understand that 1.1 is still not finalized yet, but is there any parallel effort to bring some 1.1 support to the clients? Thanks for your great work here!

gkellogg commented 7 years ago

While I believe there may be other implementations in the works, the only one I know of is my own Ruby Version: http://github.com/ruby-rdf/json-ld. It is used in developing the specs, and is fully compliant with all new 1.1 features.

newgene commented 7 years ago

@gkellogg Thanks! we will check it out.

gkellogg commented 7 years ago

Also check out dotNetRDF: https://github.com/dotnetrdf/dotnetrdf looks like it's moving in that direction.

dlongley commented 7 years ago

@newgene, we haven't implemented any 1.1 features in the JavaScript library (jsonld.js) yet. Some 1.1 work was started but had to be postponed to move cycles over to a few other projects. Also, we've now got modularizing and adding a new build system as the next highest priority change to the library. Once the restructuring is complete, it should be easier to implement new features.

All that to say -- we fully plan on implementing, it's just a matter of time and free cycles to do it.

newgene commented 7 years ago

Since the ruby client has the most complete 1.1 support, I put up a simple "jsonld playground' test site for us to test those new 1.1 features. In case anyone else finds it's useful, it's here: http://jsonld.biothings.io/.

It uses the latest Ruby json-ld client (v2.1.4) on the server-side to do the JSON-LD processing.

It meant to be a temp test site, till the actual JSON-LD playground is updated.

newgene commented 7 years ago

@gkellogg I don't know how to do the "normalize" operation using ruby client (like the normalize method in javascript client). Right now, it's the same as "N-Quads" on this temp site.

Also, the "Frame" tab is just using the empty "{}" as the "--frame" parameter.

gkellogg commented 7 years ago

@newgene That's great! I'm starting to update my own distiller which is focused on RDF transformations to handle use cases like these, and many more, by leveraging the logic behind the rdf command-line tool. To better parallel the json-ld playground, you'd need to add a separate text window to hold either a context or frame to support the appropriate function.

Normalization can be done using the rdf-normalize gem, which generates a normalized N-Quads output from a dataset.

gkellogg commented 7 years ago

If you like, add a PR to list your tool in the json-ld Developers section, perhaps in the Ruby tab. I believe @lanthaler has a playground based on his PHP version too, but not at 1.1 quite yet.

newgene commented 7 years ago

@gkellogg I just added "frame" input support.

As I'm not familiar with Ruby, this web app is built using Python, but calling your ruby client executable jsonld on-the-fly for all the JSON-LD processing. If there is a way to do "normalize" from the command line, I can then include that function in my Python web app.

gkellogg commented 7 years ago

@newgene I added the RDF::Normalization gem to the linkeddata gem, so that you can select normalize as an output format. For example: rdf serialize https://raw.githubusercontent.com/ruby-rdf/json-ld/develop/etc/doap.jsonld --output-format normalize.

newgene commented 7 years ago

@gkellogg when I try this cmd, I got an error:

$ rdf serialize https://raw.githubusercontent.com/ruby-rdf/json-ld/develop/etc/doap.jsonld --output-format normalize
rdf: No writer found for normalize. Available writers:
      jsonld: JSON-LD
      nquads: N-Quads
    ntriples: N-Triples
  vocabulary: Vocabulary

$ rdf --version
2.2.6

If this is not the version with your latest changes, I can wait till it's released.

Also, can rdf executable accept json-ld input from stdin, like jsonld executable does?

gkellogg commented 7 years ago

Make sure you have the latest version of the 'linkeddata' gem, which is included by the rdf CLI to find appropriate serializers and deserializers.

newgene commented 7 years ago

@gkellogg got it! I missed some error msg while installing "linkeddata" gem. Fixed now. "normalize" tab now works.