Skip to content

Commit

Permalink
Preliminary support for reasoning over SPARQL query results (#577)
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
matzemathics authored Jan 8, 2025
2 parents 2d18ada + bda2ca7 commit 1847c83
Show file tree
Hide file tree
Showing 48 changed files with 771 additions and 359 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
components: clippy
rust-version: nightly
- run: cargo clippy --all-targets --verbose
- run: cargo clippy --all-targets --workspace --verbose

rustfmt:
name: Verify code formatting
Expand Down
Loading

0 comments on commit 1847c83

Please sign in to comment.