Skip to content

Commit

Permalink
backend sample that works with current models / migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuerklin committed Mar 21, 2020
1 parent e507a47 commit 2c609bc
Showing 1 changed file with 200 additions and 4 deletions.
204 changes: 200 additions & 4 deletions resources/backend-sample.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,206 @@
id,name,baseUrl,ntFilePath,ntFileLastChange,isDefault,isImporting,maxDefault,filteredLanguage,dynamicSuggestions,suggestSubjects,suggestObjects,subjectName,alternativeSubjectName,predicateName,alternativePredicateName,objectName,alternativeObjectName,replacePredicates,supportedKeywords,supportedFunctions,fillPrefixes,filterEntities
9999,Wikidata Full @ Uni Freiburg,http://qlever.informatik.uni-freiburg.de/api/wikidata-full,,0,1,0,100,en,2,?qleverui_sitelink <http://schema.org/about> ?qleverui_entity,?qleverui_sitelink <http://schema.org/about> ?qleverui_entity,?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .,?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .,"{ ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
id,name,baseUrl,ntFilePath,ntFileLastChange,isDefault,isImporting,maxDefault,filteredLanguage,dynamicSuggestions,suggestSubjects,suggestPredicates,suggestObjects,subjectName,alternativeSubjectName,predicateName,alternativePredicateName,objectName,alternativeObjectName,replacePredicates,supportedKeywords,supportedFunctions,fillPrefixes,filterEntities
9999,Wikidata Full @ Uni Freiburg,http://qlever.informatik.uni-freiburg.de/api/wikidata-full,,0,1,0,100,en,2,"SELECT ?qleverui_entity (SAMPLE(?qleverui_name) as ?qleverui_name) (SAMPLE(?qleverui_altname) as ?qleverui_altname) (SAMPLE(?qleverui_count) as ?qleverui_count) WHERE {
# IF CURRENT_WORD #
{
{
# ENDIF #
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
?qleverui_sitelink <http://schema.org/about> ?qleverui_entity .
}
GROUP BY ?qleverui_entity
# IF CURRENT_WORD #
HAVING regex(?qleverui_entity, '^%<CURRENT_WORD%')
# ENDIF #
}
OPTIONAL {
?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .
}
OPTIONAL {
?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .
}
}
# IF CURRENT_WORD #
UNION
{
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
?qleverui_sitelink <http://schema.org/about> ?qleverui_entity .
}
GROUP BY ?qleverui_entity
}
?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .
FILTER regex(?qleverui_name, '^""%CURRENT_WORD%')
}
}
UNION
{
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
?qleverui_sitelink <http://schema.org/about> ?qleverui_entity .
}
GROUP BY ?qleverui_entity
}
?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .
FILTER regex(?qleverui_altname, '^""%CURRENT_WORD%')
OPTIONAL {
?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .
}
}
}
# ENDIF #
GROUP BY ?qleverui_entity
ORDER BY DESC(?qleverui_count)","%PREFIXES%
SELECT ?qleverui_entity (SAMPLE(?qleverui_name) as ?qleverui_name) (SAMPLE(?qleverui_altname) as ?qleverui_altname) (SAMPLE(?qleverui_count) as ?qleverui_count) WHERE {
# IF CURRENT_WORD #
{
{
# ENDIF #
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
%CONNECTED_LINES%
%CURRENT_SUBJECT% ql:has-predicate ?qleverui_entity .
}
GROUP BY ?qleverui_entity
# IF CURRENT_WORD #
HAVING regex(?qleverui_entity, '^%<CURRENT_WORD%')
# ENDIF #
}
OPTIONAL {
{ { { ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#statementProperty> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#qualifier> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } .
}
OPTIONAL {
{ { { ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#statementProperty> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#qualifier> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } .
}
}
# IF CURRENT_WORD #
UNION
{
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
%CONNECTED_LINES%
%CURRENT_SUBJECT% ql:has-predicate ?qleverui_entity .
}
GROUP BY ?qleverui_entity
}
{ { { ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#statementProperty> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#qualifier> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } .
FILTER regex(?qleverui_name, '^""%CURRENT_WORD%')
}
}
UNION
{
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
%CONNECTED_LINES%
%CURRENT_SUBJECT% ql:has-predicate ?qleverui_entity .
}
GROUP BY ?qleverui_entity
}
{ { { ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#statementProperty> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#qualifier> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } .
FILTER regex(?qleverui_altname, '^""%CURRENT_WORD%')
OPTIONAL {
{ { { ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#statementProperty> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#qualifier> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } .
}
}
}
# ENDIF #
GROUP BY ?qleverui_entity
ORDER BY DESC(?qleverui_count)","%PREFIXES%
SELECT ?qleverui_entity (SAMPLE(?qleverui_name) as ?qleverui_name) (SAMPLE(?qleverui_altname) as ?qleverui_altname) (SAMPLE(?qleverui_count) as ?qleverui_count) WHERE {
# IF CURRENT_WORD #
{
{
# ENDIF #
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
%CONNECTED_LINES%
%CURRENT_SUBJECT% %CURRENT_PREDICATE% ?qleverui_entity .
}
GROUP BY ?qleverui_entity
# IF CURRENT_WORD #
HAVING regex(?qleverui_entity, '^%<CURRENT_WORD%')
# ENDIF #
}
OPTIONAL {
?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .
}
OPTIONAL {
?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .
}
}
# IF CURRENT_WORD #
UNION
{
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
%CONNECTED_LINES%
%CURRENT_SUBJECT% %CURRENT_PREDICATE% ?qleverui_entity .
}
GROUP BY ?qleverui_entity
}
?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .
FILTER regex(?qleverui_name, '^""%CURRENT_WORD%')
}
}
UNION
{
{
SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
%CONNECTED_LINES%
%CURRENT_SUBJECT% %CURRENT_PREDICATE% ?qleverui_entity .
}
GROUP BY ?qleverui_entity
}
?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .
FILTER regex(?qleverui_altname, '^""%CURRENT_WORD%')
OPTIONAL {
?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .
}
}
}
# ENDIF #
GROUP BY ?qleverui_entity
ORDER BY DESC(?qleverui_count)",?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .,?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .,"{ ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name } .","{ ?qleverui_claim <http://wikiba.se/ontology#directClaim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname } UNION
{ ?qleverui_claim <http://wikiba.se/ontology#claim> ?qleverui_entity .
?qleverui_claim @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname }",?qleverui_entity @en@<http://www.w3.org/2000/01/rdf-schema#label> ?qleverui_name .,?qleverui_entity @en@<http://www.w3.org/2004/02/skos/core#altLabel> ?qleverui_altname .,"<http://www.w3.org/2000/01/rdf-schema#label> @en@<http://www.w3.org/2000/01/rdf-schema#label>
<http://schema.org/name> @en@<http://schema.org/name>
<http://wikiba.se/ontology#label> @en@<http://wikiba.se/ontology#label>","prefix, select, distinct, where, order, limit, offset, optional, by, as, having, not, textlimit, contains-entity, contains-word, filter, group, union, optional, has-predicate","asc, desc, avg, values, score, text, count, sample, min, max, average, concat, group_concat, langMatches, lang, regex, sum",1,0
<http://schema.org/name> @en@<http://schema.org/name>
<http://wikiba.se/ontology#label> @en@<http://wikiba.se/ontology#label>","prefix, select, distinct, where, order, limit, offset, optional, by, as, having, not, textlimit, contains-entity, contains-word, filter, group, union, optional, has-predicate","asc, desc, avg, values, score, text, count, sample, min, max, average, concat, group_concat, langMatches, lang, regex, sum",1,0

0 comments on commit 2c609bc

Please sign in to comment.