-
Notifications
You must be signed in to change notification settings - Fork 4
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
Reader and Writer for Concise Triples Missing #26
Comments
@houghtonap the readers and writers are for serialization formats, whereas c3 is more about programmatically creating RDF. Based on your example, I think what you might be after are the factory methods for generating triples/quads. For example, const factory = require('@graphy/core.data.factory');
let prefixes = {
rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
dbo: 'http://dbpedia.org/ontology/',
dbr: 'http://dbpedia.org/resource/',
};
let triples = factory.c3({
'dbr:Banana': {
'a': 'dbo:Fruit',
'rdfs:label': [
'Banana@en',
'Bananae@fr',
],
},
}, prefixes);
for(let triple of triples) {
console.log(triple+'');
} If you had something else in mind, could you expand on your use case a bit more? |
I have a large database (millions of rows) and need to pull select data subsets out and combine with other RDF data. I can pull this data subset by creating JSON-LD or Concise Triples. IMHO Concise Triples are simpler to deal with than JSON-LD and I would also like to use graphy, quadstore and quadstore-sparql to handle loading and analysis of the data. Graphy has support for Concise Triples, but not JSON-LD. I pulled the data subset and created Concise Triples and would prefer to stream that data, but it looks like graphy's implementation of Concise Triples wasn't meant for this use case :( I had a question on the above snippet using |
Yes, Concise triples are about constructing RDF programmatically either for passing Quads around in memory or for serializing to some RDF format such as Turtle, RDF/XML, etc. Concise triples are not a serialization format but more of an API. I am still a little unclear about your use case. Do you need to serialize the data to disk between selects and reads or can you pass objects in memory? If you can pass them in memory, using the |
Concise Triples (C3) are useful, but I noticed that there are no reader or writer for them:
This makes it more difficult to stream data, for example, one would really like to do:
The text was updated successfully, but these errors were encountered: