STLabWikifier/sparql queries
From STLab
Default sparql queris for wikifier
- Query to get resource (N.B. in this case every things that have a label)
- DBPEDIA dataset: dbpedia_labels_en/it;
- Query: WHERE {?resource etc/label ?term};
- This query is necessary and very important to decided what kind of resuource to get for indexing.
sparqlResource SELECT DISTINCT ?resource from <dbpedia_labels_en> WHERE {?resource <http://www.w3.org/2000/01/rdf-schema#label> ?term. FILTER (!(regex(str(?term),'disambiguation','i')))}
- Query to get comment
- DBPEDIA dataset: dbpedia_short_abstracts_en/it;
- Query: WHERE {<@subject> etc/comment ?cont};
- This query is necessary and very important to get comment.
sparqlComment SELECT DISTINCT ?cont from <dbpedia_short_abstracts_en> WHERE {<@subject> <http://www.w3.org/2000/01/rdf-schema#comment> ?cont}
- Query to get abstract
- DBPEDIA dataset: dbpedia_long_abstracts_en/it;
- Query: WHERE {<@subject> etc/abstract ?cont};
- This query is optional.
sparqlAbstrac SELECT DISTINCT ?cont from <dbpedia_long_abstracts_en> WHERE {<@subject> <http://dbpedia.org/ontology/abstract> ?cont}
- Query to get term (is the label)
- DBPEDIA dataset: dbpedia_labels_en/it;
- Query: WHERE {<@subject> etc/label ?term};
- This query is necessary and very important to get principal label for the resource.
sparqlLabel SELECT DISTINCT ?term from <dbpedia_labels_en> WHERE {<@subject> <http://www.w3.org/2000/01/rdf-schema#label> ?term. FILTER (!(regex(str(?redirect),'disambiguation','i')))}
- Query to get term (is the label) of the redirect from the analyzed resource.
- DBPEDIA dataset: dbpedia_redirects_en and dbpedia_labels_en/it;
- Query: WHERE {?aux etc/wikiPageRedirects <@subject>; etc/page ?redirect};
- This query is optional.
sparqlRedirect SELECT DISTINCT ?redirect from <dbpedia_redirects_en> from <dbpedia_labels_en> WHERE {?aux <http://dbpedia.org/ontology/wikiPageRedirects> <@subject>; <http://www.w3.org/2000/01/rdf-schema#label> ?redirect. FILTER (!(regex(str(?redirect),'disambiguation','i')))}
- Query to get term (is the label) of the disambiguation from the analyzed resource.
- DBPEDIA dataset: dbpedia_disambiguations_en and dbpedia_labels_en/it;
- Query: WHERE {?d etc/wikiPageDisambiguates <dbpedia_labels_en>; etc/label ?term};
- This query is optional.
sparqlDisamb SELECT DISTINCT ?disamb from <dbpedia_disambiguations_en> from <dbpedia_labels_en> WHERE {?d <http://dbpedia.org/ontology/wikiPageDisambiguates> <@subject>; <http://www.w3.org/2000/01/rdf-schema#label> ?disamb}
- Query to get the type
- DBPEDIA dataset: dbpedia_instance_types_en;
- Query: WHERE {<@subject> etc/type ?type}; http://www.w3.org/2002/07/owl#Thing
- This query is optional.
sparqlType SELECT DISTINCT ?type from <dbpedia_instance_types_en> WHERE {<@subject> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type. FILTER (str(?type)!=\"http://www.w3.org/2002/07/owl#Thing\")}
- Query to get the skos category
- DBPEDIA dataset: dbpedia_article_categories_en;
- Query: WHERE {<@subject> etc/subject ?category};
- This query is optional. But it is necessary if you want to take in account categories.
sparqlCategory SELECT DISTINCT ?category from <dbpedia_article_categories_en> WHERE {<@subject> <http://purl.org/dc/terms/subject> ?category}
- Query to get the page
- DBPEDIA dataset: dbpedia_wikipedia_links_en/it;
- Query: WHERE {<@subject> etc/page ?page};
- This query is necessary and very important to get wikipage link.
sparqlPage SELECT DISTINCT ?page from <dbpedia_wikipedia_links_en> WHERE {<@subject> <http://xmlns.com/foaf/0.1/page> ?page}
- Query to get the input-links
- DBPEDIA dataset: dbpedia_page_links_en/it;
- Query: WHERE {?link etc/wikiPageWikiLink <@object>}
- This query is necessary and very important to get number of page input link.
sparqlLink SELECT DISTINCT ?link from <dbpedia_page_links_en> WHERE {?link <http://dbpedia.org/ontology/wikiPageWikiLink> <@subject>}