SPARQL query to remove "@en"

Viewed 47

I have a large skos taxonomy that has some incorrect notation properties. Most of the properties are xsd:string but some appear with a "@en" language string. I want to modify the triples so as to remove the language string from these triples and convert them to xsd:string.

I tried the query below. It doesn't report any errors and commits successfully.

DELETE { ?s ?p ?o }
INSERT { ?s ?p ?o2 }
WHERE
{
  ?s skos:notation ?o .
  BIND(STRDT(STR(?o), xsd:string) AS ?o2)
}

However, the query does not result in any change to the triples data. Can anyone suggest where I might be going wrong?

1 Answers

Variable ?p in your query appears to be unbound. Try:

DELETE { ?s skos:notation ?o }
INSERT { ?s skos:notation ?o2 }
WHERE
{
  ?s skos:notation ?o .
  BIND(STRDT(STR(?o), xsd:string) AS ?o2)
}
Related