You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can already load EDB predicates from external sources. In theory, this could be used to query SPARQL endpoints such as the Wikidata Query Service. In practice, this results in unreadable, hardcoded IRIs and depends on the endpoint to send the results in the correct format.
Building upon #566 and #564, we can improve the ergonomics of such queries by adding a builtin and slightly generalising existing syntax, allowing, e.g.:
Addresses #569. Based on #564 and #566, so should be merged after those.
With this, we can run the following program:
```prolog
@import awards :- tsv{ resource=f"https://query.wikidata.org/sparql?query={URIENCODE(?query)}",
format=(any, string)
},
?query = """
SELECT ?award ?awardLabel WHERE {
wd:Q42 wdt:P166 ?award .
?award rdfs:label ?awardLabel FILTER(LANG(?awardLabel) = "en")
}
""".
@export awards :- csv{resource=""} .
```
This currently yields the following output:
```
[2025-01-04T00:15:11Z INFO nemo::io::formats::dsv::writer] Starting data export
?award,"""?awardLabel"""
http://www.wikidata.org/entity/Q906455,"""Ditmar Award@en"""
http://www.wikidata.org/entity/Q2687578,"""Inkpot Award@en"""
[2025-01-04T00:15:11Z INFO nemo::io::formats::dsv::writer] Finished export: processed 3 tuples (dropped 0)
```
We can already load EDB predicates from external sources. In theory, this could be used to query SPARQL endpoints such as the Wikidata Query Service. In practice, this results in unreadable, hardcoded IRIs and depends on the endpoint to send the results in the correct format.
Building upon #566 and #564, we can improve the ergonomics of such queries by adding a builtin and slightly generalising existing syntax, allowing, e.g.:
URIENCODE
builtin that percent encodes a string #571@import
and@export
directives #572Accept
headers #573User-Agent
header #574The text was updated successfully, but these errors were encountered: