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

bug: not all data is correctly removed when language tagged strings are removed #10

Closed
nvdk opened this issue Nov 12, 2021 · 4 comments
Closed

Comments

@nvdk
Copy link
Member

nvdk commented Nov 12, 2021

given the following triples:

@prefix rdf:	<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix skos:	<http://www.w3.org/2004/02/skos/core#> .

<http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825>
	rdf:type	<https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept> ;
	skos:scopeNote	"de bestuurders moeten de driekleurige verkeerslichten opvolgen."@nl ;
	<http://mu.semte.ch/vocabularies/core/uuid>	"45c13c91557317dd6b7b2b37023a3825" ;
	skos:definition	"Driekleurig systeem met cirkelvormige lichten"@nl ;
	skos:topConceptOf	<http://data.vlaanderen.be/id/conceptscheme/Verkeerslichtconcept> ;
	<http://www.w3.org/2003/06/sw-vocab-status/ns#termStatus>	<http://mow.lblod.info/VerkeersbordconceptStatus/de811976b13d96ba62aec77411a88d0ad9afc573221f2c8dee979cd8106ea77b> ;
	skos:prefLabel	"VL61.1" ;
	<https://data.vlaanderen.be/ns/mobiliteit#grafischeWeergave>	"/static/DriekleurigVerkeerslichtrond.png" ;
	skos:inScheme	<http://data.vlaanderen.be/id/conceptscheme/Verkeerslichtconcept> ;
	<http://data.lblod.info/vocabularies/mobiliteit/heeftGerelateerdVerkeerslichtconcept>	<http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/b0befd126d11214456e458e7298650d8> , <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/d4f97369827bb2c2e841e829dff85312> , <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/f6202432ede2ff8b5d6038455776eb0d> , <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/93a2c2671d90c756cc83374fd1bda1ba> , <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/4fb52503bb8ba0d7c540ae44f33b226e> , <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/00fb203200e318350886c833f6c98517> ;
	<http://mu.semte.ch/vocabularies/ext/template>	<http://data.lblod.info/templates/f30ec8be-6d77-4964-ae24-a9cb671ed467> .

if you try the following query:

db_1               | Incoming SPARQL query: PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
db_1               | PREFIX dct: <http://purl.org/dc/terms/>
db_1               | PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
db_1               | PREFIX foaf: <http://xmlns.com/foaf/0.1/>
db_1               | PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
db_1               | PREFIX dbpedia: <http://dbpedia.org/ontology/>
db_1               | PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
db_1               | PREFIX qb: <http://purl.org/linked-data/cube#>
db_1               | PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
db_1               | PREFIX owl: <http://www.w3.org/2002/07/owl#>
db_1               | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
db_1               | PREFIX sh: <http://www.w3.org/ns/shacl#>
db_1               | PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
db_1               | PREFIX vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#>
db_1               | PREFIX mobiliteit: <https://data.vlaanderen.be/ns/mobiliteit#>
db_1               | PREFIX org: <http://www.w3.org/ns/org#>
db_1               | PREFIX lblodmow: <http://data.lblod.info/vocabularies/mobiliteit/>
db_1               | PREFIX rm: <http://mu.semte.ch/vocabularies/logical-delete/>
db_1               | PREFIX typedLiterals: <http://mu.semte.ch/vocabularies/typed-literals/>
db_1               | PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
db_1               | PREFIX app: <http://mu.semte.ch/app/>
db_1               | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
db_1               | DELETE {
db_1               |     GRAPH <http://mu.semte.ch/application> {
db_1               |         <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> mobiliteit:grafischeWeergave ?__image6.
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:scopeNote ?__meaning7.
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:definition ?__definition8.
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:prefLabel ?__traffic_light_concept_code9.
db_1               | }
db_1               | } WHERE {
db_1               |     GRAPH <http://mu.semte.ch/application> {
db_1               |         OPTIONAL {     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> mobiliteit:grafischeWeergave ?__image6.
db_1               |  }
db_1               |     OPTIONAL {     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:scopeNote ?__meaning7.
db_1               |  }
db_1               |     OPTIONAL {     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:definition ?__definition8.
db_1               |  }
db_1               |     OPTIONAL {     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:prefLabel ?__traffic_light_concept_code9.
db_1               |  }
db_1               | }
db_1               | }; 
db_1               | INSERT DATA 
db_1               | {
db_1               |     GRAPH <http://mu.semte.ch/application> {
db_1               |         <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> mobiliteit:grafischeWeergave """/static/DriekleurigVerkeerslichtrond.png""".
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:scopeNote """de bestuurders moeten de driekleurige verkeerslichten opvolgen.""".
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:definition """Driekleurig systeem met cirkelvormige lichten.""".
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:prefLabel """VL61.1""".
db_1               | }
db_1               | }
db_1               | 

it will not remove the expected data, because we are not selecting the language tag

db_1               | Outgoing SPARQL query: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> PREFIX typedLiterals: <http://mu.semte.ch/vocabularies/typed-literals/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX sh: <http://www.w3.org/ns/shacl#> PREFIX rm: <http://mu.semte.ch/vocabularies/logical-delete/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX qb: <http://purl.org/linked-data/cube#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX org: <http://www.w3.org/ns/org#> PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#> PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> PREFIX mu: <http://mu.semte.ch/vocabularies/core/> PREFIX mobiliteit: <https://data.vlaanderen.be/ns/mobiliteit#> PREFIX lblodmow: <http://data.lblod.info/vocabularies/mobiliteit/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX ext: <http://mu.semte.ch/vocabularies/ext/> PREFIX dct: <http://purl.org/dc/terms/> PREFIX dbpedia: <http://dbpedia.org/ontology/> PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#> PREFIX app: <http://mu.semte.ch/app/> SELECT DISTINCT ?__image6 ?__meaning7 ?__definition8 ?__traffic_light_concept_code9 FROM <http://mu.semte.ch/graphs/mow/registry> WHERE 
db_1               | {
db_1               |   
db_1               |   {
db_1               |     OPTIONAL 
db_1               |     {
db_1               |       <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> mobiliteit:grafischeWeergave ?__image6 .
db_1               |       
db_1               |     }
db_1               |     OPTIONAL 
db_1               |     {
db_1               |       <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:scopeNote ?__meaning7 .
db_1               |       
db_1               |     }
db_1               |     OPTIONAL 
db_1               |     {
db_1               |       <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:definition ?__definition8 .
db_1               |       
db_1               |     }
db_1               |     OPTIONAL 
db_1               |     {
db_1               |       <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> skos:prefLabel ?__traffic_light_concept_code9 .
db_1               |       
db_1               |     }
db_1               |     
db_1               |   }
db_1               |   
db_1               | }
db_1               | 
db_1               | Outgoing SPARQL query: DELETE DATA 
db_1               | {
db_1               |   GRAPH <http://mu.semte.ch/graphs/mow/registry> 
db_1               |   {
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> <http://www.w3.org/2004/02/skos/core#definition> """Driekleurig systeem met cirkelvormige lichten""" 
db_1               |   }
db_1               |   
db_1               | }
db_1               | 
db_1               | Outgoing SPARQL query: INSERT DATA 
db_1               | {
db_1               |   GRAPH <http://mu.semte.ch/graphs/mow/registry> 
db_1               |   {
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> <https://data.vlaanderen.be/ns/mobiliteit#grafischeWeergave> """/static/DriekleurigVerkeerslichtrond.png""" 
db_1               |   }
db_1               |   GRAPH <http://mu.semte.ch/graphs/mow/registry> 
db_1               |   {
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> <http://www.w3.org/2004/02/skos/core#definition> """Driekleurig systeem met cirkelvormige lichten.""" 
db_1               |   }
db_1               |   GRAPH <http://mu.semte.ch/graphs/mow/registry> 
db_1               |   {
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> <http://www.w3.org/2004/02/skos/core#prefLabel> """VL61.1""" 
db_1               |   }
db_1               |   GRAPH <http://mu.semte.ch/graphs/mow/registry> 
db_1               |   {
db_1               |     <http://data.vlaanderen.be/id/concept/Verkeerslichtconcept/45c13c91557317dd6b7b2b37023a3825> <http://www.w3.org/2004/02/skos/core#scopeNote> """de bestuurders moeten de driekleurige verkeerslichten opvolgen.""" 
db_1               |   }
db_1               |   
db_1               | }
db_1               | 
@nvdk
Copy link
Member Author

nvdk commented Nov 12, 2021

so to summarize: When you do a delete where query mu auth does a select and delete data query. The delete data is in this case is incorrect. Mu auth should either do a more extensive select so it also gets possible language tags or a construct query. Currently the delete data query is incorrect as a result .

I think we should use a construct rather than a select query to solve this, it's likely to be more performant and easier to get the datatype and language of each literal.

@nvdk
Copy link
Member Author

nvdk commented Nov 15, 2021

looks like this was already reported ealier: #2

@erikap
Copy link
Member

erikap commented Nov 23, 2023

Seems to be fixed in release v0.6.0-beta.8

@nvdk
Copy link
Member Author

nvdk commented Nov 24, 2023

can confirm this has been fixed 🆗

@nvdk nvdk closed this as completed Nov 24, 2023
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