Comments (8)
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.
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.
Hi @ckristo, thanks for the pointers. Maybe you could make a pull request with your util method?
Cheers,
Reto
from rdf-ext.
@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.
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.
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.
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.
Implemented in rdf-mime-type-util
from rdf-ext.
Related Issues (20)
- Contains function? HOT 1
- PrefixMap.addAll should return this HOT 12
- Set withCredentials to true in utils.defaultRequest HOT 2
- createLiteral or createTriple cannot handle non-string values HOT 7
- Use request instead HOT 5
- Use inherits instead of util.inherit HOT 2
- Auto-resolve CURIEs on NamedNode creation HOT 8
- Allow to create blank nodes with custom label HOT 8
- Support priorities in Parsers class HOT 1
- Is it possible to serialize a graph to RDF/XML? HOT 4
- List RDF/XML serializer in documentation HOT 2
- Abstract serializer link is broken in README HOT 1
- is there a non-browserify distribution available HOT 2
- Support RDFJS DataFactory interface HOT 3
- Allow to set Authorization header HOT 2
- UglifyJS chokes on ES2015 code HOT 4
- Failing to parse RDF/XML with 'rdfxml-streaming-parser''? HOT 10
- Regression in 1.3.4 HOT 2
- Using versions 2.0.0 and 2.0.1 in typescript env throws error HOT 1
- Reduce function? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdf-ext.