aws / aws/graph-explorer

[Bug] Value in "Limit returned neighbors to" is exceeded (SPARQL ENDPOINT)

Open
#184 2 comments 0 reactions 0 assignees View on GitHub
exploration performance reliability sparql
Dominant language
TypeScript
Stars
481
Forks
108
Avg merge
6d 8h
Merged PRs (30d)
5

Description

Hello,

I'm using graph-explorer:1.3.1, have a SPARQL endpoint and try to query a nodes neighbor with the "Limit returned neighbors to" set to 5. The generated SPARQL query was:

```sparql
SELECT ?subject ?pred ?value ?subjectClass ?pToSubject ?pFromSubject {
?subject a ?subjectClass;
?pred ?value {
SELECT DISTINCT ?subject ?pToSubject ?pFromSubject {
BIND( AS ?argument)
VALUES ?subjectClass { }
{
?argument ?pToSubject ?subject.
?subject a ?subjectClass;
?sPred ?sValue .
}
UNION
{
?subject ?pFromSubject ?argument;
a ?subjectClass;
?sPred ?sValue .
}
}
LIMIT 5 OFFSET 0
}
FILTER(isLiteral(?value))
}
```

The limit in the subquery works fine e.g.

```sparql
SELECT DISTINCT ?subject ?pToSubject ?pFromSubject {
BIND( AS ?argument)
VALUES ?subjectClass { }
{
?argument ?pToSubject ?subject.
?subject a ?subjectClass;
?sPred ?sValue .
}
UNION
{
?subject ?pFromSubject ?argument;
a ?subjectClass;
?sPred ?sValue .
}
}
```

But the surrounding query returns way more than five entries and so does the graph-explorer. In the following example it returned 6 neighbors but the deviation varies:
![image](https://github.com/aws/graph-explorer/assets/78928688/2364485a-eba2-4e35-ac89-b3478addc6db)

I would like to have the exact number of neighbors I selected previously.

Kind regards Stefan

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.