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

Demonstrat interop with rdflib.js #11

Open
nicholascar opened this issue Mar 20, 2022 · 4 comments
Open

Demonstrat interop with rdflib.js #11

nicholascar opened this issue Mar 20, 2022 · 4 comments

Comments

@nicholascar
Copy link
Contributor

nicholascar commented Mar 20, 2022

rdflib.js is, I think, the major JavaScript RDF toolkit. How does Ontola's Hextuples software interoperate with it, if at all?

I'm expecting to see something like the HexTuples parser being able to produce a filled rdflib.js store but I can't see this myself.

What about serializing an rdflib.js store to HexTuples?

@joepio
Copy link
Member

joepio commented Mar 20, 2022

Hi! I think adding both hextuples parsing and serialisation logic to rdflib.js shouldn't be too hard. I've worked on that library some time ago ago (converting it to typescript and documenting functions), and it's definitely doable. But I don't think that I'll be implementing this, since we're not using rdflib.js anymore. It's performance isn't as good as @ontola/core @ontologies/core + link-lib, which is optimized for hextuples.

@nicholascar
Copy link
Contributor Author

So what JS library would you recommend for doing general RDF manipulation after loading HexTuples or other RDF data?

You mention @ontoloa/core but where exactly is that repo? I can't see 'core' in https://github.com/ontola/.

Is the library you mention fully features for RDF manipulation? Can you serialize to formats other than HexT? Can you loop through RDF data, add to it programmatically, perhaps SPARQL query it?

I'm starting to need RDF libraries in JS and I'm not too thrilled with rdflib.js, so I'd appreciate any pointers to what others find useful.

@joepio
Copy link
Member

joepio commented Mar 20, 2022

Whoops, I meant to type @ontologies/core! https://github.com/ontola/ontologies

We use link-lib (by @rescribet) for storing and querying in a JS context. Check out its match function. It, in turn, uses @ontologies/core. I don't think it supports multiple RDF serialization output formats or SPARQL queries, but its query options are good enough to power our SAAS e-democracy platform Argu.co.

@nicholascar
Copy link
Contributor Author

Thanks for the pointer @joepio! ontola/ontologies does look pretty easy to use so I'll give it a go!

I see you have a similar thing to Python RDFLib for providing well-known namespaces to users. This has been a tricky thing in RDFLib due to some people wanting lots of namespaces included, others none! We have about 20 at the moment (https://github.com/RDFLib/rdflib/tree/master/rdflib/namespace).

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

No branches or pull requests

2 participants