Coder Social home page Coder Social logo

Comments (8)

ckristo avatar ckristo commented on June 18, 2024

Hi,

I've looked for that as well -- as far as I could find out, rdf-ext does not support that currently, so I've written a quick util function for my project; you can find it here: https://gist.github.com/ckristo/93630ad51b3937fe4246

Based on that function, I've also created a fetchAndParse that fetches a remote RDF document and performs parsing based on a given content type or content negotiation when no content type is given.

@bergos I saw that utils.js is your work -- maybe you can include (an adapted version) of my functions for utils.js?

from rdf-ext.

ckristo avatar ckristo commented on June 18, 2024

I stumbled upon the source of LdpStore and saw that it implements (some) of these functionality. Maybe this could be extracted to util functions so that others can use it without the need of using LdpStore...

from rdf-ext.

retog avatar retog commented on June 18, 2024

Hi @ckristo, thanks for the pointers. Maybe you could make a pull request with your util method?

Cheers,
Reto

from rdf-ext.

bergos avatar bergos commented on June 18, 2024

@ckristo You are right about the LdpStore stuff. The parser and serializer mime type map should be part of the utils and LdpStore should use that one. I added the parser stuff to the utils + added a simple mocha test case in the last version (git+npm).

Todo:

  • Implement the serializer mime type map + util function + test case
  • Replace LdpStore code with utils code

from rdf-ext.

ckristo avatar ckristo commented on June 18, 2024

PR for the first TODO ready, see #32 -- was a quite easy exercise based on your work @bergos :-)

Next up: use the new utils functions within LdpStore, here some remaining questions for that:

  • What should happen to options.parsers and options.serializers? Can we remove it? Or is there a good reason for keeping it (and allow to disable certain parsers / serializers)
  • LdpStore implements another parser for application/sparql-update (LdpStore.serializeSparqlUpdate) -- should it be available only in LdpStore, or should we expose it and make available in rdf.utils.serialize

from rdf-ext.

ckristo avatar ckristo commented on June 18, 2024

Btw.: What about adding a utils function for fetching data and parsing it based on its content type header (like my fetchAndParse method)? Is that appreciated? If yes, I would give that a try also.

from rdf-ext.

bergos avatar bergos commented on June 18, 2024

Thanks for the patch.

I just created a SparqlUpdateSerializer. Now we have everything to replace the LdpStore code. We should keep the options.parsers and options.serializers. For example the RDFa parser is not feature complete, but maybe someone wants to use it.

I'm not sure where to place the fetch & parse method. After thinking about the SPARQL stuff, maybe the LdpStore (btw. should be forked/renamed to WebStore) is the right place.

from rdf-ext.

bergos avatar bergos commented on June 18, 2024

Implemented in rdf-mime-type-util

from rdf-ext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.