From: Jim B. <ba...@ne...> - 2015-03-11 16:37:14
|
Hi, I am having a confusing issue with SPARQL update and wanted to verify my expectations. Submitting this update using curl returns immediately and reports 0 mutations: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX ps: <http://purl.org/phenoscape/vocab.owl#> PREFIX obo: <http://purl.obolibrary.org/obo/> WITH <http://kb.phenoscape.org/ic> INSERT { ?annotation ps:reflexive_subClassOf ?subsumer . } WHERE { ?term ps:has_phenotypic_profile/rdf:type ?annotation . ?annotation rdfs:subClassOf* ?subsumer . FILTER(isIRI(?subsumer)) } If I change the query into a SELECT using the same WHERE clause, I get many results. If I edit the update to put the WHERE contents into a subquery, it no longer returns immediately. It seems to getting results, but I am not sure because it eventually runs out of memory before completing. This is the modified update with subquery: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX ps: <http://purl.org/phenoscape/vocab.owl#> PREFIX obo: <http://purl.obolibrary.org/obo/> WITH <http://kb.phenoscape.org/ic> INSERT { ?annotation ps:reflexive_subClassOf ?subsumer . } WHERE { SELECT DISTINCT ?annotation ?subsumer WHERE { ?term ps:has_phenotypic_profile/rdf:type ?annotation . ?annotation rdfs:subClassOf* ?subsumer . FILTER(isIRI(?subsumer)) } } Should these two queries have the same results? If I am getting no data inserted in the first case, might I be hitting a bug? Based on a SELECT query, the WHERE clause definitely matches content in the database. Thank you, Jim |