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

Properly clear triples in fuseki when updating a single play #233

Open
cmil opened this issue Dec 23, 2023 · 0 comments
Open

Properly clear triples in fuseki when updating a single play #233

cmil opened this issue Dec 23, 2023 · 0 comments

Comments

@cmil
Copy link
Member

cmil commented Dec 23, 2023

Until now we only clear the fuseki graph for an entire corpus when we update the corpus in total. When updating individual documents of a corpus, ignorer to avoid duplicates, we would have to delete existing triples before posting a new RDF representation to the triple store the following way:

  1. Remove triples of blank node used to hook wikidata-id to the creator of the play:
WITH <https://dracor.org/test> DELETE
	{
  		?play <http://dracor.org/ontology#has_author> ?node.
		?node ?p ?o .
	} 
WHERE 

{
  		?play <http://dracor.org/ontology#has_author> ?node.
		?node ?p ?o .
}	
  1. remove Triples of characters of a single play:
WITH <https://dracor.org/test> DELETE {
    <https://dracor.org/entity/greek000026> schema:character ?character. 
    ?character ?p ?o
} WHERE {
    <https://dracor.org/entity/greek000026> schema:character ?character. 
    ?character ?p ?o
} 
  1. remove Triples of the creation-event:
WITH <https://dracor.org/test> DELETE { 
    ?creation crm:P94_has_created <https://dracor.org/entity/greek000026> ;
    ?p ?o . } 
WHERE { 
    ?creation crm:P94_has_created <https://dracor.org/entity/greek000026> ;
    ?p ?o .
}
  1. remove the remaining triples:
WITH <https://dracor.org/test> DELETE {
    <https://dracor.org/entity/greek000026> ?p ?o} 
WHERE {
    <https://dracor.org/entity/greek000026> ?p ?o
}

The problem is, that there is currently only a connection from the play to the character; so we have to remove them with a separate query. The information on the author of a play is attached at two points (1. cidoc-like via a creation event, 2. via property of the dracor-ontology dracon:has_author) We maybe could include it only once (1.?), this would save an update operation, but makes it probably more complicated to query the author-info. I should probably think of a way to include the inverse path of schema:character to connect play to character, but I'm not sure if this is possible within schema.org. And, maybe, the queries could be combined into one, but I unfortunately don't know how.

Prefixes I included while testing:

PREFIX frbroo: <http://iflastandards.info/ns/fr/frbr/frbroo/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>

Originally posted by @ingoboerner in #77 (comment)

@cmil cmil mentioned this issue Dec 23, 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

1 participant