1 year ago

#275643

test-img

Rwz Stha

Issue when updating triple with blank nodes using sqarql

  • This is my query, this query works fine for nodes with no blank node but the issue with arrives while updating with blank node

    here those nodes get repeated 100 times after updating

    DELETE {
    it:4D9AT21jAasfL9ah schema:description ?o_0 .
    it:4D9AT21jAasfL9ah it:hasArea ?o_1 .
    ?o_1 rdf:type ?o_1_0 .  ?o_1 schema:unitCode ?o_1_1 .
    ?o_1 schema:value ?o_1_2 .  ?o_1 schema:unitText ?o_1_3 .
    it:4D9AT21jAasfL9ah it:unresolvedWikidataType ?o_2 .
    it:4D9AT21jAasfL9ah schema:longitude ?o_3 .
    it:4D9AT21jAasfL9ah schema:addressCountry ?o_4 .
    it:4D9AT21jAasfL9ah rdfs:label ?o_5 .
    it:4D9AT21jAasfL9ah rdf:type ?o_6 .
    it:4D9AT21jAasfL9ah schema:url ?o_7 .
    it:4D9AT21jAasfL9ah it:wikiLink ?o_8 .
 }
    INSERT {
    it:4D9AT21jAasfL9ah  schema:description 'city and capital of Bali, Indonesia' . 
    it:4D9AT21jAasfL9ah  it:hasArea _:bQRrRFzX1zv9qUGWy . 
    _:bQRrRFzX1zv9qUGWy  rdf:type schema:QuantitativeValue; 
    schema:unitCode 'KMK'; 
    schema:value '123.98'; 
    schema:unitText 'km²' . 
    it:4D9AT21jAasfL9ah  it:unresolvedWikidataType 'Q3199141', 'Q13220204' . 
    it:4D9AT21jAasfL9ah  schema:longitude '115.21666666667' . 
    it:4D9AT21jAasfL9ah  schema:addressCountry it:WtC49aYLe8s0lsFC . 
    it:4D9AT21jAasfL9ah  rdfs:label 'Denpasar' . 
    it:4D9AT21jAasfL9ah  rdf:type schema:City . 
    it:4D9AT21jAasfL9ah  schema:url <http://www.denpasarkota.go.id/> . 
    it:4D9AT21jAasfL9ah  it:wikiLink <https://en.wikipedia.org/wiki/Denpasar> .
     }
     WHERE {
    it:4D9AT21jAasfL9ah ?p ?o .
    OPTIONAL {  it:4D9AT21jAasfL9ah schema:description ?o_0 }
    OPTIONAL {  it:4D9AT21jAasfL9ah it:hasArea ?o_1 }
    OPTIONAL {  ?o_1 rdf:type ?o_1_0 }
    OPTIONAL {  ?o_1 schema:unitCode ?o_1_1 }
    OPTIONAL {  ?o_1 schema:value ?o_1_2 }
    OPTIONAL {  ?o_1 schema:unitText ?o_1_3 }
    OPTIONAL {  it:4D9AT21jAasfL9ah it:unresolvedWikidataType ?o_2 }
    OPTIONAL {  it:4D9AT21jAasfL9ah schema:longitude ?o_3 }
    OPTIONAL {  it:4D9AT21jAasfL9ah schema:addressCountry ?o_4 }
    OPTIONAL {  it:4D9AT21jAasfL9ah rdfs:label ?o_5 }
    OPTIONAL {  it:4D9AT21jAasfL9ah rdf:type ?o_6 }
    OPTIONAL {  it:4D9AT21jAasfL9ah schema:url ?o_7 }
    OPTIONAL {  it:4D9AT21jAasfL9ah it:wikiLink ?o_8 }
 }

This is the output in json format, and only hasArea which has blank node values is being repeated many times

"schema:latitude": [
  "-7.164444444444444"
],
"it:hasArea": [
  {
    "rdf:type": [
      "schema:QuantitativeValue"
    ],
    "schema:unitCode": [
      "KMK"
    ],
    "schema:value": [
      "392.47"
    ],
    "schema:unitText": [
      "km²"
    ]
  },
  {
    "rdf:type": [
      "schema:QuantitativeValue"
    ],
    "schema:unitCode": [
      "KMK"
    ],
    "schema:value": [
      "392.47"
    ],
    "schema:unitText": [
      "km²"
    ]
  },
  {
    "rdf:type": [
      "schema:QuantitativeValue"
    ],
    "schema:unitCode": [
      "KMK"
    ],
    "schema:value": [
      "392.47"
    ],
    "schema:unitText": [
      "km²"
    ]
  },...
],
"rdfs:label": [
  "Denpasar"
],
...

Thanks in advance

sparql

rdf

rdfs

graphdb

blank-nodes

0 Answers

Your Answer

Accepted video resources