<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://graphit.ur.de/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASPARQL</id>
	<title>Module:SPARQL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://graphit.ur.de/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASPARQL"/>
	<link rel="alternate" type="text/html" href="https://graphit.ur.de/w/index.php?title=Module:SPARQL&amp;action=history"/>
	<updated>2026-05-14T08:26:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://graphit.ur.de/w/index.php?title=Module:SPARQL&amp;diff=722&amp;oldid=prev</id>
		<title>Admin: change base URL to graphit.ur.de</title>
		<link rel="alternate" type="text/html" href="https://graphit.ur.de/w/index.php?title=Module:SPARQL&amp;diff=722&amp;oldid=prev"/>
		<updated>2023-05-31T12:45:05Z</updated>

		<summary type="html">&lt;p&gt;change base URL to graphit.ur.de&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:45, 31 May 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l10&quot;&gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		linktext = label .. &amp;quot; (&amp;quot; .. id .. &amp;quot;)&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		linktext = label .. &amp;quot; (&amp;quot; .. id .. &amp;quot;)&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	link = &amp;#039;https://&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;www&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikidata&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;org&lt;/del&gt;/wiki/&amp;#039; .. prefix .. id&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	link = &amp;#039;https://&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;graphit&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ur&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;de&lt;/ins&gt;/wiki/&amp;#039; .. prefix .. id&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	return &amp;#039;[&amp;#039; .. link .. &amp;#039; &amp;#039; .. linktext .. &amp;#039;]&amp;#039;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	return &amp;#039;[&amp;#039; .. link .. &amp;#039; &amp;#039; .. linktext .. &amp;#039;]&amp;#039;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://graphit.ur.de/w/index.php?title=Module:SPARQL&amp;diff=703&amp;oldid=prev</id>
		<title>Admin: Copied from Mediawiki.org</title>
		<link rel="alternate" type="text/html" href="https://graphit.ur.de/w/index.php?title=Module:SPARQL&amp;diff=703&amp;oldid=prev"/>
		<updated>2023-05-31T10:41:36Z</updated>

		<summary type="html">&lt;p&gt;Copied from Mediawiki.org&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Return the label of a given data item, formatted for linking&lt;br /&gt;
local function getLabel(id, prefix)&lt;br /&gt;
	if prefix == nil then prefix = &amp;#039;&amp;#039; end&lt;br /&gt;
	label = mw.wikibase.label( id )&lt;br /&gt;
	if label == nil then&lt;br /&gt;
		linktext = id&lt;br /&gt;
	else &lt;br /&gt;
		linktext = label .. &amp;quot; (&amp;quot; .. id .. &amp;quot;)&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	link = &amp;#039;https://www.wikidata.org/wiki/&amp;#039; .. prefix .. id&lt;br /&gt;
	return &amp;#039;[&amp;#039; .. link .. &amp;#039; &amp;#039; .. linktext .. &amp;#039;]&amp;#039;;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function map(func, array)&lt;br /&gt;
  local new_array = {}&lt;br /&gt;
  for i,v in ipairs(array) do&lt;br /&gt;
    new_array[i] = func(v)&lt;br /&gt;
  end&lt;br /&gt;
  return new_array&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getAll(text, regexp, seen, items) &lt;br /&gt;
	if items == nil then items = {} end&lt;br /&gt;
	if seen == nil then seen = {} end&lt;br /&gt;
	for item in string.gmatch(text, regexp) do&lt;br /&gt;
		if seen[item] == nil then&lt;br /&gt;
			seen[item] = 1&lt;br /&gt;
			table.insert(items, item)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return items&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Produce list of items mentioned in the query&lt;br /&gt;
function p.getItems(frame)&lt;br /&gt;
	if not mw.wikibase then&lt;br /&gt;
		return &amp;quot;no mw.wikibase&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	items = getAll(frame.args[1], &amp;#039;wd:(Q%d+)&amp;#039;)&lt;br /&gt;
	return table.concat(map(getLabel, items), &amp;quot;, &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Produce list of properties mentioned in the query&lt;br /&gt;
function p.getProperties(frame)&lt;br /&gt;
	if not mw.wikibase then&lt;br /&gt;
		return &amp;quot;no mw.wikibase&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	seen = {}&lt;br /&gt;
	items = {}&lt;br /&gt;
	prefixes = {&amp;#039;wdt&amp;#039;, &amp;#039;p&amp;#039;, &amp;#039;ps&amp;#039;, &amp;#039;pr&amp;#039;, &amp;#039;pq&amp;#039;, &amp;#039;psv&amp;#039;, &amp;#039;pv&amp;#039;, &amp;#039;prv&amp;#039;, &amp;#039;pqv&amp;#039; }&lt;br /&gt;
	for _, pr in ipairs(prefixes) do&lt;br /&gt;
		items = getAll(frame.args[1], pr .. &amp;#039;:(P%d+)&amp;#039;, seen, items)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(map(function(it) return getLabel(it, &amp;#039;Property:&amp;#039;) end, items), &amp;quot;, &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>