blazegraph / database

Blazegraph High Performance Graph Database
GNU General Public License v2.0
872 stars 170 forks source link

Running UPDATE queries remotely #208

Closed jpadfield closed 2 years ago

jpadfield commented 2 years ago

Hi,

I have been trying to run some admin functions such as DROP and CLEAR against named graphs using various PYTHON libraries and have not had a lot of luck.

I have a simple install of Blazegraph, so just running the current Jar file, and I can create and destroy named graphs in the Workbench and I wanted to know if I should be able to create and destroy named graphs via the SPARQL end-point with a query submitted via python?

Is this type of function limited in the default install, do I need to set up more security or config options etc?

I have had various errors, but a number of the attempts seem to run the command and return a 200 success, but then nothing has actually happened.

So should a query like this work: 'DROP GRAPH http://127.0.0.1:9999/blazegraph/namespace/test'? (the python scripts are running on the same server)

And if so, some hints to track down why it might not be working would be great.

Thanks

Joe

thompsonbry commented 2 years ago

I suspect you might not be escaping things correctly.

See https://github.com/blazegraph/database/wiki/REST_API and https://www.w3.org/TR/sparql11-update/#drop

If you look at the examples in the latter, you can see the use of angle brackets around IRIs.

COPY DEFAULT TO http://example.org/named

On Thu, Aug 26, 2021 at 7:17 AM Joseph Padfield @.***> wrote:

Hi,

I have been trying to run some admin functions such as DROP and CLEAR against named graphs using various PYTHON libraries and have not had a lot of luck.

I have a simple install of Blazegraph, so just running the current Jar file, and I can create and destroy named graphs in the Workbench and I wanted to know if I should be able to create and destroy named graphs via the SPARQL end-point with a query submitted via python?

Is this type of function limited in the default install, do I need to set up more security or config options etc?

I have had various errors, but a number of the attempts seem to run the command and return a 200 success, but then nothing has actually happened.

So should a query like this work: 'DROP GRAPH http://127.0.0.1:9999/blazegraph/namespace/test'?

And if so, some hints to track down why it might not be working would be great.

Thanks

Joe

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blazegraph/database/issues/208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATW7YDEJJQVYFPONMVEUALT6ZEJHANCNFSM5C3O62OQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

jpadfield commented 2 years ago

Thanks, sorry, my fault I forgot to type the < & > in for the issue - I have been using them in my code. I will check the other links, though I think I have looked at them.

So, just to check I should be able to run a DROP query from python on the same server, on the default setup?

thompsonbry commented 2 years ago

yes.

On Thu, Aug 26, 2021 at 11:09 AM Joseph Padfield @.***> wrote:

Thanks, sorry, my fault I forgot to type the < & > in for the issue - I have been using them in my code. I will check the other links, though I think I have looked at them.

So, just to check I should be able to run a DROP query from python on the same server, on the default setup?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blazegraph/database/issues/208#issuecomment-906629616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATW7YDZJBS44Z3IRZB7ZC3T6Z7MHANCNFSM5C3O62OQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

jpadfield commented 2 years ago

Thanks, knowing it should work, I have spent a bit more time on it and have a solution. The issue was that DROP was not actually removing the named graph it was effectively CLEARing it.

I assume that this is something to do with the documented behaviour in relation to the DEFAULT graph needing to be recreated after it is removed.

Either way I can work round this now, thanks.

thompsonbry commented 2 years ago

Different quad stores have different semantics for DROP. Blazegraph implicitly creates and destroys named graphs. All you do is add a triple to one for it to exist and remove the last triple for it to go away. Some platforms have explicit CREATE and DESTROY semantics for named graphs, treating them more as entities in their own right vs a simple aggregation of whether any triples exist for the named graph. Both semantics are allowed by the specifications.

Bryan

On Fri, Aug 27, 2021 at 2:38 AM Joseph Padfield @.***> wrote:

Thanks, knowing it should work, I have spent a bit more time on it and have a solution. The issue was that DROP was not actually removing the named graph it was effectively CLEARing it.

I assume that this is something to do with the documented behaviour in relation to the DEFAULT graph needing to be recreated after it is removed.

Either way I can work round this now, thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blazegraph/database/issues/208#issuecomment-907069052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATW7YBM3C5XBWQMZNDMSZTT65MHXANCNFSM5C3O62OQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jpadfield commented 2 years ago

Thanks