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

Operations with graphs #186

Open
b-mandelbrot opened this issue May 10, 2015 · 4 comments
Open

Operations with graphs #186

b-mandelbrot opened this issue May 10, 2015 · 4 comments
Labels
Milestone

Comments

@b-mandelbrot
Copy link

Is there a way to realize operations with graphs? I have two graphs and I need to subtract them.

@gkellogg
Copy link
Member

The Ruby RDF toolset doesn't specifically have such a tool, or an RDF Diff tool, which would be useful, however you may be able to achieve what you want using a SPARQL MINUS or SPARQL UPDATE DELETE WHERE, both available using the SPARQL gem. Note that the problem is that BNodes in two different graphs are different, and a simple removal doesn't work. Even if you load the same serialization into two different graphs, the BNodes aren't equivalent.

However, if you can put the graph you want to do in a SPARQL WHERE clause, BNodes act like existential variables, so that they will match BNodes that have the same pattern.

Lastly, on the books to implement is RDF Normalization, which might work, as it can create canonical serializations of both graphs allowing a text diff to work, or by skolemizing the BNodes in each graph using normalized identifiers allowing the use of something like RDF::Mutable.delete.

@gkellogg
Copy link
Member

See issue #209 on how rdf-normalize might add a diff command to the rdf executable.

@gkellogg gkellogg added this to the 2.0 milestone Sep 15, 2015
@no-reply no-reply reopened this Jan 12, 2016
@no-reply
Copy link
Member

(closed by mistake)

@no-reply
Copy link
Member

This seems like a punt for 2.0 so I'm removing the tag.

I have some ideas about supporting graph operations through FFI to C and/or Rust, but think this is a larger work chunk than we can take on on the 2.0 timeline. It would be useful for any interested parties to chime in on use cases.

@no-reply no-reply removed this from the 2.0 milestone Jan 30, 2016
@gkellogg gkellogg added this to the 3.0 milestone Oct 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants