-
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.
resolves #401
- Loading branch information
Showing
4 changed files
with
106 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
##################################################### | ||
# Create an E53_Place from a d-nb.info RDF endpoint # | ||
# the second regex is for testing | ||
regex = "https://d-nb.info.*|/.*wien.rdf" | ||
superclass = "apis_ontology.models.Place" | ||
sameas = """ | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
SELECT ?sameas | ||
WHERE { | ||
?subject owl:sameAs ?sameas | ||
} | ||
""" | ||
[[attributes]] | ||
# label | ||
sparql = """ | ||
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#> | ||
SELECT ?label | ||
WHERE { | ||
?subject gndo:preferredNameForThePlaceOrGeographicName ?label | ||
} | ||
""" | ||
[[attributes]] | ||
# longitude | ||
sparql = ''' | ||
PREFIX geo: <http://www.opengis.net/ont/geosparql#> | ||
SELECT ?longitude | ||
WHERE { | ||
?subject geo:hasGeometry ?geo1 . | ||
?geo1 geo:asWKT ?point . | ||
BIND(REPLACE(str(?point), "Point \\( \\+?(-?\\d+.\\d+).*", "$1") as ?longitude) | ||
} | ||
''' | ||
[[attributes]] | ||
# latitude | ||
sparql = ''' | ||
PREFIX geo: <http://www.opengis.net/ont/geosparql#> | ||
SELECT ?latitude | ||
WHERE { | ||
?subject geo:hasGeometry ?geo1 . | ||
?geo1 geo:asWKT ?point . | ||
BIND(REPLACE(str(?point), "^Point\\s*\\(\\s*[+-]?\\d+\\.\\d+\\s+([+-]?\\d+\\.\\d+)\\s*\\)$", "$1") as ?latitude) | ||
} | ||
''' | ||
[[attributes]] | ||
# sameAs | ||
sparql = ''' | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
SELECT (GROUP_CONCAT(?sameas_pre; separator='|') as ?sameas) | ||
WHERE { | ||
?subject owl:sameAs ?sameas_pre | ||
} | ||
GROUP BY ?subject | ||
''' |