-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rework SPARQL query to fetch data from LINDAS. (Object URIs were renamed which caused errors downstream) - Shorten SPARQL code (makes query faster). - Remove duplicate entries with R script.
- Loading branch information
1 parent
b5f00e3
commit 4f0ac43
Showing
6 changed files
with
362 additions
and
384 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
PREFIX cube: <https://cube.link/> | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
PREFIX schema: <http://schema.org/> | ||
PREFIX time: <http://www.w3.org/2006/time#> | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
|
||
SELECT ?measure ?year ?month | ||
WHERE { | ||
GRAPH <https://lindas.admin.ch/foag/agricultural-market-data> { | ||
FILTER (?product in ( <https://agriculture.ld.admin.ch/foag/product/138> ) ) | ||
FILTER (?valueChainDetail in ( <https://agriculture.ld.admin.ch/foag/value-chain-detail/18> ) ) | ||
FILTER (?costComponent in ( <https://agriculture.ld.admin.ch/foag/cost-component/1> ) ) | ||
FILTER (?productOrigin in ( <https://agriculture.ld.admin.ch/foag/product-origin/0>, <https://agriculture.ld.admin.ch/foag/product-origin/1> ) ) | ||
FILTER (?productionSystem in ( <https://agriculture.ld.admin.ch/foag/production-system/3> ) ) | ||
FILTER (?product in ( <https://agriculture.ld.admin.ch/foag/product/239> ) ) # Select UHT milk | ||
FILTER (?productionSystem in ( <https://agriculture.ld.admin.ch/foag/production-system/3> ) ) # Only select conventional milk | ||
<https://agriculture.ld.admin.ch/foag/cube/MilkDairyProducts/Consumption_Price_Month> cube:observationSet ?observationSet . | ||
?observationSet cube:observation ?observation . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/cost-component> ?costComponent . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/product> ?product . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/product-origin> ?productOrigin . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/production-system> ?productionSystem . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/value-chain-detail> ?valueChainDetail . | ||
?observation <https://agriculture.ld.admin.ch/foag/measure/price> ?measure . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/date> ?date . | ||
} | ||
?date time:year ?year. | ||
?date time:month ?month. | ||
} ORDER BY ?year ?month | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
PREFIX cube: <https://cube.link/> | ||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||
PREFIX schema: <http://schema.org/> | ||
PREFIX time: <http://www.w3.org/2006/time#> | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
PREFIX dimension: <https://agriculture.ld.admin.ch/foag/dimension> | ||
|
||
SELECT ?month ?year ?measure | ||
WHERE { | ||
GRAPH <https://lindas.admin.ch/foag/agricultural-market-data> { | ||
FILTER (?product in ( <https://agriculture.ld.admin.ch/foag/product/142> ) ) | ||
FILTER (?costComponent in ( <https://agriculture.ld.admin.ch/foag/cost-component/0>,<https://agriculture.ld.admin.ch/foag/cost-component/1> ) ) | ||
FILTER (?product in ( <https://agriculture.ld.admin.ch/foag/product/243> ) ) | ||
FILTER (?productOrigin in ( <https://agriculture.ld.admin.ch/foag/product-origin/1> ) ) | ||
<https://agriculture.ld.admin.ch/foag/cube/MilkDairyProducts/Production_Price_Month> cube:observationSet ?observationSet . | ||
?observationSet cube:observation ?observation . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/cost-component> ?costComponent . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/product> ?product . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/product-origin> ?productOrigin . | ||
?observation <https://agriculture.ld.admin.ch/foag/measure/price> ?measure . | ||
?observation <https://agriculture.ld.admin.ch/foag/dimension/date> ?date . | ||
} | ||
?date time:year ?year. | ||
?date time:month ?month. | ||
} ORDER BY ?year ?month | ||
} |
This file contains 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
Oops, something went wrong.