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

Fix error with LIMIT clause in gpviz #282

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kglab/gpviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class GPViz:
"lazy",
"service_string",
"term",
"start", # used by LIMIT
"length" # used by LIMIT
]

# colorcet glasbey_category10 first 16 colors
Expand Down
26 changes: 26 additions & 0 deletions tests/test_gpviz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from .test_querying import kg_test_data

import kglab

from .__init__ import DAT_FILES_DIR

QUERY1 = """
SELECT ?recipe ?definition
WHERE {
?recipe rdf:type wtm:Recipe .
?recipe skos:definition ?definition .
?recipe wtm:hasIngredient ind:ChickenEgg .
?recipe wtm:hasIngredient ind:AllPurposeFlour .
?recipe wtm:hasIngredient ind:Salt .
?recipe wtm:hasIngredient ind:VanillaExtract
}
LIMIT 2
"""

def test_gpviz(kg_test_data):
try:
kg_test_data.visualize_query(QUERY1)
except:
assert False

assert True