STLabWikifier/sparql queries

From STLab

Jump to: navigation, search

Default sparql queris for wikifier

  1. Query to get resource (N.B. in this case every things that have a label)
  2. DBPEDIA dataset: dbpedia_labels_en/it;
  3. Query: WHERE {?resource etc/label ?term};
  4. 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')))}


  1. Query to get comment
  2. DBPEDIA dataset: dbpedia_short_abstracts_en/it;
  3. Query: WHERE {<@subject> etc/comment ?cont};
  4. 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}


  1. Query to get abstract
  2. DBPEDIA dataset: dbpedia_long_abstracts_en/it;
  3. Query: WHERE {<@subject> etc/abstract ?cont};
  4. This query is optional.

sparqlAbstrac SELECT DISTINCT ?cont from <dbpedia_long_abstracts_en> WHERE {<@subject> <http://dbpedia.org/ontology/abstract> ?cont}


  1. Query to get term (is the label)
  2. DBPEDIA dataset: dbpedia_labels_en/it;
  3. Query: WHERE {<@subject> etc/label ?term};
  4. 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')))}


  1. Query to get term (is the label) of the redirect from the analyzed resource.
  2. DBPEDIA dataset: dbpedia_redirects_en and dbpedia_labels_en/it;
  3. Query: WHERE {?aux etc/wikiPageRedirects <@subject>; etc/page ?redirect};
  4. 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')))}


  1. Query to get term (is the label) of the disambiguation from the analyzed resource.
  2. DBPEDIA dataset: dbpedia_disambiguations_en and dbpedia_labels_en/it;
  3. Query: WHERE {?d etc/wikiPageDisambiguates <dbpedia_labels_en>; etc/label ?term};
  4. 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}


  1. Query to get the type
  2. DBPEDIA dataset: dbpedia_instance_types_en;
  3. Query: WHERE {<@subject> etc/type ?type}; http://www.w3.org/2002/07/owl#Thing
  4. 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\")}


  1. Query to get the skos category
  2. DBPEDIA dataset: dbpedia_article_categories_en;
  3. Query: WHERE {<@subject> etc/subject ?category};
  4. 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}


  1. Query to get the page
  2. DBPEDIA dataset: dbpedia_wikipedia_links_en/it;
  3. Query: WHERE {<@subject> etc/page ?page};
  4. 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}


  1. Query to get the input-links
  2. DBPEDIA dataset: dbpedia_page_links_en/it;
  3. Query: WHERE {?link etc/wikiPageWikiLink <@object>}
  4. 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>}

Personal tools