Skip to content

Commit

Permalink
Add dbpedia_direct ld search config and scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrlc committed Nov 8, 2023
1 parent 0abeb76 commit d21e4a6
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
53 changes: 51 additions & 2 deletions config/authorities/linked_data/dbpedia_direct.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"QA_CONFIG_VERSION": "2.1",
"prefixes": {
"dbpedia": "http://dbpedia.org/property/"
"dbo": "http://dbpedia.org/ontology/"
},
"term": {
"url": {
Expand Down Expand Up @@ -36,5 +36,54 @@
"sameas_ldpath": "owl:sameAs ::xsd:anyURI"
}
},
"search": {}
"search": {
"url": {
"@context": "http://www.w3.org/ns/hydra/context.jsonld",
"@type": "IriTemplate",
"template": "https://dbpedia.org/sparql?query=CONSTRUCT+%7B+%3Furi+rdfs%3Alabel+%3Flabel%3B+foaf%3Aname+%3Fname%3B+dbo%3Aabstract+%3Fabstract.+%7D+WHERE+%7B+%7B+%3Furi+rdfs%3Alabel+%3FlabelMatch+FILTER%28bif%3Acontains%28%3FlabelMatch%2C+%27%22{query}*%22%27%29+%26%26+langMatches%28lang%28%3FlabelMatch%29%2C%22{lang}%22%29%29+%7D+UNION+%7B+%3Furi+foaf%3Aname+%3FnameMatch+FILTER%28bif%3Acontains%28%3FnameMatch%2C+%27%22{query}*%22%27%29+%26%26+langMatches%28lang%28%3FnameMatch%29%2C%22{lang}%22%29%29+%7D+OPTIONAL+%7B+%3Furi+rdfs%3Alabel+%3Flabel+%7D+OPTIONAL+%7B+%3Furi+foaf%3Aname+%3Fname+%7D+OPTIONAL+%7B%3Furi+dbo%3Aabstract+%3Fabstract+%7D+FILTER%28%28%21bound%28%3Flabel%29+%7C%7C+langMatches%28lang%28%3Flabel%29%2C%22{lang}%22%29%29+%26%26+%28%21bound%28%3Fname%29+%7C%7C+langMatches%28lang%28%3Fname%29%2C%22{lang}%22%29%29+%26%26+%28%21bound%28%3Fabstract%29+%7C%7C+langMatches%28lang%28%3Fabstract%29%2C%22{lang}%22%29%29%29+%7D&format=application%2Frdf%2Bxml&timeout=30000",
"variableRepresentation": "BasicRepresentation",
"mapping": [
{
"@type": "IriTemplateMapping",
"variable": "query",
"property": "hydra:freetextQuery",
"required": true,
"encode": true
},
{
"@type": "IriTemplateMapping",
"variable": "lang",
"property": "hydra:freetextQuery",
"required": false,
"default": "en"
}
]
},
"qa_replacement_patterns": {
"query": "query",
"lang": "lang"
},
"results": {
"label_ldpath": "rdfs:label :: xsd:string"
},
"context": {
"properties": [
{
"property_label_i18n": "qa.linked_data.authority.dbpedia_direct.label",
"property_label_default": "Label",
"ldpath": "rdfs:label :: xsd:string"
},
{
"property_label_i18n": "qa.linked_data.authority.dbpedia_direct.name",
"property_label_default": "Name",
"ldpath": "foaf:name :: xsd:string"
},
{
"property_label_i18n": "qa.linked_data.authority.dbpedia_direct.abstract",
"property_label_default": "Abstract",
"ldpath": "dbo:abstract :: xsd:string"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
---
authority:
service: direct
search:
#------------------
# Connection tests
#------------------
-
query: 'Barack Obama'
#------------------
# Accuracy tests
#------------------
-
query: Volleyball
position: 5
subject_uri: "http://dbpedia.org/resource/Volleyball"
-
query: Volleyb
position: 5
subject_uri: "http://dbpedia.org/resource/Volleyball"
-
query: volleyb
position: 5
subject_uri: "http://dbpedia.org/resource/Volleyball"
term:
-
identifier: 'http://dbpedia.org/resource/Barack_Obama'
4 changes: 4 additions & 0 deletions config/locales/qa_server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ en:
qa:
linked_data:
authority:
dbpedia_direct:
abstract: Abstract
label: Label
name: Name
getty_direct:
parent_body: Parent Body
homosaurus_direct:
Expand Down

0 comments on commit d21e4a6

Please sign in to comment.