<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://neowiki.ijs.si/w/index.php?action=history&amp;feed=atom&amp;title=Developers</id>
	<title>Developers - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://neowiki.ijs.si/w/index.php?action=history&amp;feed=atom&amp;title=Developers"/>
	<link rel="alternate" type="text/html" href="https://neowiki.ijs.si/w/index.php?title=Developers&amp;action=history"/>
	<updated>2026-11-25T12:32:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://neowiki.ijs.si/w/index.php?title=Developers&amp;diff=111&amp;oldid=prev</id>
		<title>NeoWiki: Importing NeoWiki demo data</title>
		<link rel="alternate" type="text/html" href="https://neowiki.ijs.si/w/index.php?title=Developers&amp;diff=111&amp;oldid=prev"/>
		<updated>2026-11-24T15:53:20Z</updated>

		<summary type="html">&lt;p&gt;Importing NeoWiki demo data&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;NeoWiki exposes a programmable surface: a graph database, parser functions, a Lua library, special pages, and a REST API. This page demonstrates each, showing the wikitext source alongside the rendered result.&lt;br /&gt;
&lt;br /&gt;
== Browse ==&lt;br /&gt;
&lt;br /&gt;
* [[Special:NeoWiki]]: the newest Subjects and links to the other NeoWiki pages&lt;br /&gt;
* [[Special:Schemas]]: all schemas&lt;br /&gt;
* [[Special:Layouts]]: all layouts&lt;br /&gt;
* [[Special:Mappings]]: all ontology mappings&lt;br /&gt;
* [[Special:Subject/sEpfwJLnxyQy6vR|Special:Subject/&amp;amp;lt;subject id&amp;amp;gt;]]: one Subject, the Subjects it references, and the ones that reference it; the id is in the ID line of the Subject&amp;#039;s Data tab row&lt;br /&gt;
&lt;br /&gt;
== Query the graph ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#sparql_raw}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; parser function runs a SPARQL query and returns the raw JSON.&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#sparql_raw:SELECT ?museum ?visitors WHERE { ?m &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&amp;gt; &amp;lt;{{SERVER}}/schema/Museum&amp;gt; . ?m &amp;lt;http://www.w3.org/2000/01/rdf-schema#label&amp;gt; ?museum . ?m &amp;lt;{{SERVER}}/prop/Annual_visitors&amp;gt; ?visitors } ORDER BY DESC(?visitors) LIMIT 5}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{#sparql_raw:SELECT ?museum ?visitors WHERE { ?m &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&amp;gt; &amp;lt;{{SERVER}}/schema/Museum&amp;gt; . ?m &amp;lt;http://www.w3.org/2000/01/rdf-schema#label&amp;gt; ?museum . ?m &amp;lt;{{SERVER}}/prop/Annual_visitors&amp;gt; ?visitors } ORDER BY DESC(?visitors) LIMIT 5}}&lt;br /&gt;
&lt;br /&gt;
{{#ifexist:SPARQL queries|[[SPARQL queries]] has more examples, from Lua and over REST too.}}&lt;br /&gt;
&lt;br /&gt;
Cypher queries need a Neo4j backend. On a wiki with one, the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#cypher_raw}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; parser function runs the same query in Cypher:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#cypher_raw:MATCH (m:Museum) RETURN m.name AS name, m.`Annual visitors` AS visitors ORDER BY visitors DESC LIMIT 5}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Read values in wikitext ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#neowiki_value}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; parser function reads a single property from a subject on a page.&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#neowiki_value:Annual visitors|page=Rijksmuseum}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result: {{#neowiki_value:Annual visitors|page=Rijksmuseum}}&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#neowiki_value:Founded at|page=ACME Inc}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result: {{#neowiki_value:Founded at|page=ACME Inc}}&lt;br /&gt;
&lt;br /&gt;
== Create subjects from wikitext ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#create_subject}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; parser function renders a button that opens the Subject creator, optionally fixed to a Schema and a target page.&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#create_subject: schema=City | page=new | text=Add a city}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{#create_subject: schema=City | page=new | text=Add a city}}&lt;br /&gt;
&lt;br /&gt;
== Read values in Lua ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;mw.neowiki&amp;lt;/code&amp;gt; Lua library exposes structured data to your Scribunto modules. The example below reads a single property and runs a SPARQL query.&lt;br /&gt;
&lt;br /&gt;
[[Module:LuaExample]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
local nw = require( &amp;#039;mw.neowiki&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
function p.foundedYear( frame )&lt;br /&gt;
	local year = nw.getValue( &amp;#039;Founded&amp;#039;, { page = frame.args[1] } )&lt;br /&gt;
	return tostring( year or &amp;#039;&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.largestMuseums( frame )&lt;br /&gt;
	if not nw.sparqlQuery then&lt;br /&gt;
		return &amp;quot;&amp;#039;&amp;#039;This list needs a SPARQL store.&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local base = mw.site.server&lt;br /&gt;
	local result = nw.sparqlQuery(&lt;br /&gt;
		&amp;#039;SELECT ?label ?visitors WHERE { &amp;#039; ..&lt;br /&gt;
		&amp;#039;?m &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&amp;gt; &amp;lt;&amp;#039; .. base .. &amp;#039;/schema/Museum&amp;gt; . &amp;#039; ..&lt;br /&gt;
		&amp;#039;?m &amp;lt;http://www.w3.org/2000/01/rdf-schema#label&amp;gt; ?label . &amp;#039; ..&lt;br /&gt;
		&amp;#039;?m &amp;lt;&amp;#039; .. base .. &amp;#039;/prop/Annual_visitors&amp;gt; ?visitors &amp;#039; ..&lt;br /&gt;
		&amp;#039;} ORDER BY DESC(?visitors) LIMIT 3&amp;#039;&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
	local list = {}&lt;br /&gt;
	for _, binding in ipairs( result.results.bindings ) do&lt;br /&gt;
		list[#list + 1] = &amp;#039;* &amp;#039; .. binding.label.value .. &amp;#039; (&amp;#039; .. binding.visitors.value .. &amp;#039; visitors)&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat( list, &amp;#039;\n&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Invoke it from wikitext:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#invoke:LuaExample|foundedYear|Rijksmuseum}}&lt;br /&gt;
&lt;br /&gt;
{{#invoke:LuaExample|largestMuseums}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
Rijksmuseum was founded in {{#invoke:LuaExample|foundedYear|Rijksmuseum}}.&lt;br /&gt;
&lt;br /&gt;
Museums with the most visitors in this demo:&lt;br /&gt;
&lt;br /&gt;
{{#invoke:LuaExample|largestMuseums}}&lt;br /&gt;
&lt;br /&gt;
For the full library reference, see the [https://neowiki.ai/docs/authoring/lua-api Lua API documentation].&lt;br /&gt;
&lt;br /&gt;
== Reactive UI ==&lt;br /&gt;
&lt;br /&gt;
NeoWiki components embed in pages as reactive UIs that update without a page reload. See [[Subject views]] for the same Sandbox subject in three layouts, with edits propagating between them.&lt;br /&gt;
&lt;br /&gt;
== REST API ==&lt;br /&gt;
&lt;br /&gt;
NeoWiki exposes a REST API for reading and writing structured data. The OpenAPI 3.0 spec is auto-generated:&lt;br /&gt;
&lt;br /&gt;
* OpenAPI spec: &amp;lt;code&amp;gt;[{{SERVER}}{{SCRIPTPATH}}/rest.php/specs/v0/module/- /rest.php/specs/v0/module/-]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Module discovery: &amp;lt;code&amp;gt;[{{SERVER}}{{SCRIPTPATH}}/rest.php/specs/v0/discovery /rest.php/specs/v0/discovery]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Representative read endpoints:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;GET /neowiki/v0/subject/{subjectId}&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GET /neowiki/v0/schema/{schemaName}&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GET /neowiki/v0/schema/{schemaName}/json-schema&amp;lt;/code&amp;gt;: a Schema&amp;#039;s Subjects as a [https://neowiki.ai/docs/api/json-schema JSON Schema] document, for validating data before upload; try [{{SERVER}}{{SCRIPTPATH}}/rest.php/neowiki/v0/schema/Person/json-schema Person]&lt;br /&gt;
&lt;br /&gt;
For full endpoint documentation, see the OpenAPI spec above.&lt;/div&gt;</summary>
		<author><name>NeoWiki</name></author>
	</entry>
</feed>