semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

Bnode Id's Re-used in INSERT queries #61

Open agpreynolds opened 10 years ago

agpreynolds commented 10 years ago

Hello I have encountered an issue whereby if I insert two sets of triples with blank nodes attached, the blank node ID's are the same for both sets.

For example, running the two insert statements below in separate requests results in each of the recipes having both ingredient lists attached.

INSERT INTO <...> myRecipe:Pizza a recipe:Recipe ; rdfs:label "Pizza" recipe:ingredients [ a recipe:IngredientList ; rdf:_1 [ a recipe:Ingredient ; recipe:food myFood:Chicken ; ] ]

INSERT INTO <...> myRecipe:Carbonara a recipe:Recipe ; rdfs:label "Spaghetti Carbonara" recipe:ingredients [ a recipe:IngredientList ; rdf:_1 [ a recipe:Ingredient ; recipe:food myFood:Bacon ; ] ]

Therefore running a query such as the following will return both of the previously inserted recipes

SELECT ?recipe WHERE { ?recipe a recipe:Recipe ; recipe:ingredients ?ingredients . ?ingredients ?p ?s . ?s a recipe:Ingredient ; recipe:food myFood:Chicken }

Note: this is only an issue when using the insert mechanism, the bnodes are parsed correctly when importing from a file in ttl format using the load mechanism.