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

Assert and Retract #10

Open
PaulBrownMagic opened this issue Nov 11, 2019 · 3 comments
Open

Assert and Retract #10

PaulBrownMagic opened this issue Nov 11, 2019 · 3 comments

Comments

@PaulBrownMagic
Copy link

Hi,

Are there any plans to implement rdf_assert/3 and rdf_retractall/4 to create SPARQL insert and delete queries? I couldn't find them in the docs and testing in the obvious way threw errors.

Kind regards,
Paul

@cmungall
Copy link
Owner

How would you expect this to work?

A translation of rdf_assert(rdf(S,P,O)) to SPARQL should be straightforward

It's not clear how asserted terms whose predicates are used in rules should be handled.

Perhaps these could be rewritten such that if we have

name(X,Y):- rdf(X,foaf:name,Y).

and say rdf_assert(name(id:123,"fred")) then the appropriate SPARQL using foaf:name would be used?

@PaulBrownMagic
Copy link
Author

As sparqlprog mirrors rdf/3 in a query like endpoint ?? rdf(S, P, O). I'd expect it to mirror rdf_assert/3 in the same way: endpoint ?? rdf_assert(S, P, O)., also endpoint ?? rdf_retractall(S, P, O).

A rule then would be:

assert_name(X, Y) :- rdf_assert(X, foaf:name, Y).

?- endpoint ?? assert_name(id:123, "fred").

Mirroring the existing predicates in SWI's semweb library increases transferability, but your idea has a certain elegance to it. Personally, I'd just be happy to have the feature, no matter the implementation.

@cmungall
Copy link
Owner

cmungall commented Nov 11, 2019 via email

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