wikipedia

Using SPARQL to query DBPedia Company Information

假如想象 提交于 2019-12-06 11:49:01
I'm trying to query DBPedia using SPARQL only to find company information such as a description, and a logo. I'm rather lost with devising the SPARQL Query to do this. SELECT DISTINCT ?subject ?employees ?homepage WHERE { ?subject rdf:type <http://dbpedia.org/class/yago/Company108058098> . ?subject dbpedia2:numEmployees ?employees FILTER ( xsd:integer(?employees) >= 50000 ) . ?subject foaf:homepage ?homepage . } ORDER BY DESC(xsd:integer(?employees)) LIMIT 20 I have come across the above query, which finds companies with over 50,000 emplayoees, but I don't understand such things as the rdf

How to get all links and their Wikidata IDs for a Wikipedia page?

▼魔方 西西 提交于 2019-12-06 11:29:03
问题 (When) will the following be possible? get the list of all links on a Wikipedia page with their respective Wikidata IDs in a single query/API call. receive additional information of the respective Wikidata items like a property value with the query. 回答1: To get all Wikipedia page links you have to use Wikipedia API, and to get all Wikidata item properties you need Wikidata API, so it is not possible to create one query with two requests to both APIs. But! The first part of your question is

Which wiki markup parser does Wikipedia use?

人走茶凉 提交于 2019-12-06 09:43:26
None of these parsers are used by Wikipedia; None of them handle the wiki code correctly. Does anyone know what parser Wikipedia uses? Wikipedia uses MediaWiki , which has its own parser . Wikipedia runs on the Mediawiki engine, originally written precisely to use for Wikipedia. They implement their own parser . A more thorough description of the parser is available in the manual . 来源: https://stackoverflow.com/questions/5956883/which-wiki-markup-parser-does-wikipedia-use

PHP + Wikipedia: Get content from the first paragraph in a Wikipedia article?

て烟熏妆下的殇ゞ 提交于 2019-12-06 09:25:50
I’m trying to use Wikipedia’s API (api.php) to get the content of a Wikipedia article provided by a link (like: http://en.wikipedia.org/wiki/Stackoverflow ). And what I want is to get the first paragraph (which in the example of the Stackoverflow wiki article is: Stack Overflow is a website part of the Stack Exchange network[2][3] featuring questions and answers on a wide range of topics in computer programming.[4][5][6] ). I’m going to do some data manipulation with it. I’ve tried with the API url: http://en.wikipedia.org/w/api.php?action=parse&page=Stackoverflow&format=xml but it gives me

Find main category for article using Wikipedia API

时光总嘲笑我的痴心妄想 提交于 2019-12-06 06:44:05
问题 I have a list of articles and I want to find the main category of each article. Wikipedia lists its main categories here - http://en.wikipedia.org/wiki/Portal:Contents/Categories. I am able to find the subcategories of each article using: http://en.wikipedia.org/w/api.php?action=query&prop=categories&titles=%s&format=xml I also am able to check whether a subcategory is within a category: http://en.wikipedia.org/w/api.php?action=query&titles=Dog&prop=categories&clcategories=Domesticated

iframe wikipedia article without the wrapper

让人想犯罪 __ 提交于 2019-12-06 05:36:58
I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: http://www.dayah.com/periodic/ . Click on an element and the iframe is displayed and links to the article only (no wrapper). So how'd they do that? Seems like JavaScript handles showing the iframe and constructing the href but after browsing the pages javascript ( http://www.dayah.com/periodic/Script/interactivity.js ) I still can't figure out how the url is built. Thanks. The periodic table example loads the printer-friendly version of the wiki

How to get abstract and thumbnail of a Wikipedia article from article DBPedia?

半城伤御伤魂 提交于 2019-12-06 05:04:54
问题 I am new to SPARQL. With this query, I can get the birthName of Ernest Hemingway: select distinct ?birthName where { ?person a dbpedia-owl:Person . ?person dbpprop:birthName ?birthName . FILTER (regex(?birthName, "Ernest Miller Hemingway")) } LIMIT 1 Is there a way I can get the wikipedia abstract/introduction and thumbnail of Ernest Hemingway with DBPedia? 回答1: In general, the best way to start querying DBpedia if you already have an idea what you're looking for is to look at the page for

Query Wikipedia pages with properties

心不动则不痛 提交于 2019-12-06 02:12:22
问题 I need to use Wikipedia API Query or any other api such as Opensearch to query for a simple list of pages with some properties. Input: a list of page (article) titles or ids. Output: a list of pages that contain the following properties each: page id title snippet/description (like in opensearch api) page url image url (like in opensearch api) A result similar to this: http://en.wikipedia.org/w/api.php?action=opensearch&search=miles%20davis&limit=20&format=xml Only with page ids and not for a

Easy way to export Wikipedia's translated titles

好久不见. 提交于 2019-12-06 00:59:09
Is there an easy way to export Wikipedia's translated titles to get a set like this: russian_title -> english_title ? I tried to get ones from ruwiki-latest-pages-meta-current.xml.bz2 and ruwiki-latest-pages-articles.xml.bz2 , however, there are less than 25k translations. I found out some are not present. E.g. one can see a link to English wiki here , but there is no link [[en:Yandex]] in the dump. Maybe I should try to parse English Wikipedia, but I'm sure there is a nicer solution. BTW, I'm using wikixmlj + tried to find en:Yandex with grep . UPD: link to @svick's solution data: http:/

Wikipedia API: how to get the number of revisions of a page?

我的未来我决定 提交于 2019-12-05 21:12:00
问题 Anyone know how to get the number of revisions of a wikipedia page using mediawiki API? I have read this API documentation, but can't find the related API: Revision API 回答1: The only possibility is to retrieve all revisions and count them. You might need to continue the query for that. Bug 17993 is about including a count, but is still unsolved. 回答2: Here is code to get number of revisions of a page (in this case, the JSON wiki page): import requests BASE_URL = "http://en.wikipedia.org/w/api