protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
969 stars 229 forks source link

Is "SPARQL Query" and "Snap SPARQL" tab not supporting "DELETE" still? #1202

Open yasenstar opened 1 month ago

yasenstar commented 1 month ago

Hello,

I have several classes in the ontology which I want to remove their subClassOf to one wrongly mapped super class, when I try to use below query - abc:superClassName is the target superClass:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX abc: <URI#>
SELECT ?subject
    DELETE { ?subject rdfs:subClassOf abc:superClassName . }
    WHERE{ ?subject rdfs:subClassOf abc:superClassName . }

I got below "Syntax error in SPARQL query":

Encountered DELETE at line 7 column 5. Expected one of: Variable WHERE (

However, only use WHERE clause return the correct scope of result.

Read some discussions and looks the SPARQL plugin in Protege forbidden the DELETE (and UPDATE) related command, could anyone help on this and let me know how I can perform those clean-up action instead of manually do that?

Thanks, Xiaoqi

ykazakov commented 1 month ago

Looks like this question is regarding a Protege plugin, not the Protege itself. I suggest ti move it here:

https://github.com/protegeproject/sparql-query-plugin

Perhaps you could even find the answer in the source code.

yasenstar commented 1 month ago

Thanks, could you let me know how to move this to another project? Agree it's relating to https://github.com/protegeproject/sparql-query-plugin. Or I need to recreate another post in that plug-in project?

I'll search source code then as well.

Xiaoqi