<?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=EDM_queries</id>
	<title>EDM queries - 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=EDM_queries"/>
	<link rel="alternate" type="text/html" href="https://neowiki.ijs.si/w/index.php?title=EDM_queries&amp;action=history"/>
	<updated>2026-11-25T12:50:47Z</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=EDM_queries&amp;diff=116&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=EDM_queries&amp;diff=116&amp;oldid=prev"/>
		<updated>2026-11-24T15:53:29Z</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;This wiki&amp;#039;s SPARQL store holds two [[RDF and ontology mappings|projections]] of its pages: the &amp;#039;&amp;#039;&amp;#039;native&amp;#039;&amp;#039;&amp;#039; one, in NeoWiki&amp;#039;s own vocabulary, and the &amp;#039;&amp;#039;&amp;#039;EDM&amp;#039;&amp;#039;&amp;#039; one defined by [[Mapping:EDM]], which targets the [https://pro.europeana.eu/page/edm-documentation Europeana Data Model]. A query can be written in EDM terms, in native terms, or in both at once.&lt;br /&gt;
&lt;br /&gt;
Every example below uses 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 and returns raw [https://www.w3.org/TR/sparql11-results-json/ SPARQL JSON]. The Lua and REST surfaces answer the same queries — see [[SPARQL queries]].&lt;br /&gt;
&lt;br /&gt;
== Query in EDM terms ==&lt;br /&gt;
&lt;br /&gt;
The Person and Artist Schemas both map to &amp;lt;code&amp;gt;edm:Agent&amp;lt;/code&amp;gt;, so a query in EDM terms spans them without knowing either Schema. The birth date sits in its own &amp;lt;code&amp;gt;GRAPH&amp;lt;/code&amp;gt; block because it does not always live with the agent: where a birth is modelled as its own Subject, [[Mapping:EDM]] contributes &amp;lt;code&amp;gt;rdaGr2:dateOfBirth&amp;lt;/code&amp;gt; from the Birth page&amp;#039;s graph instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#sparql_raw:PREFIX edm: &amp;lt;http://www.europeana.eu/schemas/edm/&amp;gt; PREFIX rdaGr2: &amp;lt;http://rdvocab.info/ElementsGr2/&amp;gt; PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt; SELECT ?agent ?dateOfBirth WHERE { GRAPH ?agentGraph { ?a a edm:Agent ; rdfs:label ?agent } GRAPH ?birthGraph { ?a rdaGr2:dateOfBirth ?dateOfBirth } } ORDER BY ?agent}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{#sparql_raw:PREFIX edm: &amp;lt;http://www.europeana.eu/schemas/edm/&amp;gt; PREFIX rdaGr2: &amp;lt;http://rdvocab.info/ElementsGr2/&amp;gt; PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt; SELECT ?agent ?dateOfBirth WHERE { GRAPH ?agentGraph { ?a a edm:Agent ; rdfs:label ?agent } GRAPH ?birthGraph { ?a rdaGr2:dateOfBirth ?dateOfBirth } } ORDER BY ?agent}}&lt;br /&gt;
&lt;br /&gt;
A relation projects as a direct triple between two entity IRIs, so a query follows it the way it would in any EDM dataset. The artwork and its creator live on separate wiki pages, hence in separate named graphs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#sparql_raw:PREFIX edm: &amp;lt;http://www.europeana.eu/schemas/edm/&amp;gt; PREFIX dc: &amp;lt;http://purl.org/dc/elements/1.1/&amp;gt; PREFIX dcterms: &amp;lt;http://purl.org/dc/terms/&amp;gt; PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt; SELECT ?work ?created ?creator WHERE { GRAPH ?workGraph { ?w a edm:ProvidedCHO ; rdfs:label ?work ; dcterms:created ?created ; dc:creator ?c } GRAPH ?creatorGraph { ?c a edm:Agent ; rdfs:label ?creator } } ORDER BY ?created}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{#sparql_raw:PREFIX edm: &amp;lt;http://www.europeana.eu/schemas/edm/&amp;gt; PREFIX dc: &amp;lt;http://purl.org/dc/elements/1.1/&amp;gt; PREFIX dcterms: &amp;lt;http://purl.org/dc/terms/&amp;gt; PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt; SELECT ?work ?created ?creator WHERE { GRAPH ?workGraph { ?w a edm:ProvidedCHO ; rdfs:label ?work ; dcterms:created ?created ; dc:creator ?c } GRAPH ?creatorGraph { ?c a edm:Agent ; rdfs:label ?creator } } ORDER BY ?created}}&lt;br /&gt;
&lt;br /&gt;
== Query across both projections ==&lt;br /&gt;
&lt;br /&gt;
[[Mapping:EDM]] maps no predicate for the Person Schema&amp;#039;s &amp;lt;code&amp;gt;Source&amp;lt;/code&amp;gt; property, so it is absent from the EDM projection — the native projection still has it as &amp;lt;code&amp;gt;neo-prop:Source&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Both projections mint the same entity IRIs, so one query can take the birth date from EDM and the source from the native projection:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mediawiki&amp;quot;&amp;gt;&lt;br /&gt;
{{#sparql_raw:PREFIX edm: &amp;lt;http://www.europeana.eu/schemas/edm/&amp;gt; PREFIX rdaGr2: &amp;lt;http://rdvocab.info/ElementsGr2/&amp;gt; PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt; PREFIX neo-prop: &amp;lt;{{SERVER}}/prop/&amp;gt; SELECT ?agent ?dateOfBirth ?source ?edmGraph ?nativeGraph WHERE { GRAPH ?edmGraph { ?a a edm:Agent ; rdaGr2:dateOfBirth ?dateOfBirth } GRAPH ?nativeGraph { ?a rdfs:label ?agent ; neo-prop:Source ?source } } ORDER BY ?agent}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{#sparql_raw:PREFIX edm: &amp;lt;http://www.europeana.eu/schemas/edm/&amp;gt; PREFIX rdaGr2: &amp;lt;http://rdvocab.info/ElementsGr2/&amp;gt; PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt; PREFIX neo-prop: &amp;lt;{{SERVER}}/prop/&amp;gt; SELECT ?agent ?dateOfBirth ?source ?edmGraph ?nativeGraph WHERE { GRAPH ?edmGraph { ?a a edm:Agent ; rdaGr2:dateOfBirth ?dateOfBirth } GRAPH ?nativeGraph { ?a rdfs:label ?agent ; neo-prop:Source ?source } } ORDER BY ?agent}}&lt;br /&gt;
&lt;br /&gt;
== Set this up ==&lt;br /&gt;
&lt;br /&gt;
Each store entry names one projection, and several entries may point at one endpoint — see [https://neowiki.ai/docs/operations/installation#several-projections-in-one-store Several projections in one store]. The [https://github.com/ProfessionalWiki/NeoWiki/blob/master/Docker/SettingsTemplate.php NeoWiki development stack] points a &amp;lt;code&amp;gt;native&amp;lt;/code&amp;gt; and an &amp;lt;code&amp;gt;EDM&amp;lt;/code&amp;gt; entry at one QLever, which is why these queries reach both.&lt;br /&gt;
&lt;br /&gt;
== Learn more ==&lt;br /&gt;
&lt;br /&gt;
* [https://neowiki.ai/docs/authoring/mapping-format Mapping format reference]&lt;br /&gt;
* [https://neowiki.ai/docs/guide/person-to-edm Person-to-EDM worked example]&lt;/div&gt;</summary>
		<author><name>NeoWiki</name></author>
	</entry>
</feed>