Repository navigation
Conversation
Layer: 1-sparql-blank-node-neighbor-counts
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a SPARQL node's neighbors include blank nodes that have no triples of their own, expanding the node made the neighbor counts request fail, because those blank nodes were not recognized as blank nodes.
User-facing: On SPARQL databases such as the Nobel Prize dataset, expanding a node with blank node neighbors (for example a laureate's death place) now loads neighbor counts for every neighbor, instead of failing with "Malformed SPARQL query".
A blank node that appears only as an edge endpoint got no vertex from the quad mapper.
fetchNeighborsfilled it in as a plain vertex, so it never entered the blank node map, andneighborCountssent its label to the database as an IRI (<d31718…>), which strict endpoints reject for the whole batch.mapQuadToEntities(bindings) for each binding if edge binding add edge + for each blank node endpoint (subject or object) + add vertex draft { id, isBlankNode: true }, merged with any other draft else add vertex draft from the bindingEvidence
Before: expanding Nobel laureate 259 sent both count queries with
<d31718c5856d46f9aa8963926f0fd13299>inVALUES, and the endpoint answered 400 "Malformed SPARQL query" to each.After: new tests in the mapper,
fetchNeighbors, and the SPARQL explorer fail without the fix and pass with it. The explorer test runsfetchNeighborsthenneighborCountsand checks that no counts query contains the blank node label as<label>and that the blank node goes down the blank node path.Verified live: expanded laureate 259 against the public Nobel Prize SPARQL endpoint through the dev server. All five SPARQL requests returned 200, the count queries listed only the five URI neighbors, and every URI neighbor showed its count.
Merge Danger
Door: two-way
Impact: small
Edge-only blank nodes are now treated like every other blank node, so they are no longer saved in the graph session, matching existing blank node behavior.
Related
🤖 Written by an AI agent on my behalf.