<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sparna Blog &#187; knowledge graph</title>
	<atom:link href="https://blog.sparna.fr/tag/knowledge-graph/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sparna.fr</link>
	<description>Web de données &#124; Architecture de l&#039;information &#124; Accès aux connaissances</description>
	<lastBuildDate>Tue, 03 Jun 2025 10:30:27 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>European Parliament Open Data Portal : a SHACL-powered knowledge graph</title>
		<link>https://blog.sparna.fr/2025/04/09/european-parliament-open-data-portal-a-shacl-powered-knowledge-graph/</link>
		<comments>https://blog.sparna.fr/2025/04/09/european-parliament-open-data-portal-a-shacl-powered-knowledge-graph/#comments</comments>
		<pubDate>Wed, 09 Apr 2025 14:10:12 +0000</pubDate>
		<dc:creator><![CDATA[Marie Muller]]></dc:creator>
				<category><![CDATA[Editeurs]]></category>
		<category><![CDATA[FAIR]]></category>
		<category><![CDATA[Linked Data]]></category>
		<category><![CDATA[Non classé]]></category>
		<category><![CDATA[Ontologies]]></category>
		<category><![CDATA[Open Data]]></category>
		<category><![CDATA[SHACL]]></category>
		<category><![CDATA[SHACL Play]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[DCAT]]></category>
		<category><![CDATA[ELI]]></category>
		<category><![CDATA[google spreadsheets]]></category>
		<category><![CDATA[json-ld]]></category>
		<category><![CDATA[knowledge graph]]></category>
		<category><![CDATA[SKOS]]></category>
		<category><![CDATA[SPARQL]]></category>

		<guid isPermaLink="false">https://blog.sparna.fr/?p=1959</guid>
		<description><![CDATA[<p>A second usecase Thomas wrote for Veronika Heimsbakk’s SHACL for the Practitioner upcoming book is about Sparna&#8217;s work for the European Parliament. From validation of the data in the knowledge graph to further projects of data integration and dissemination, many different usages of SHACL specifications were explored&#8230; &#8230; and more exploratory usages of SHACL are foreseen ! “&#8230;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2025/04/09/european-parliament-open-data-portal-a-shacl-powered-knowledge-graph/">European Parliament Open Data Portal : a SHACL-powered knowledge graph</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>A second usecase Thomas wrote for Veronika Heimsbakk’s <em><a href="https://veronahe.wordpress.com/shacl-for-the-practitioner/">SHACL for the Practitioner</a></em> upcoming book is about Sparna&rsquo;s work for the European Parliament.</p>
<p>From validation of the data in the knowledge graph to further projects of data integration and dissemination, many different usages of SHACL specifications were explored&#8230;</p>
<p>&#8230; and more exploratory usages of SHACL are foreseen !</p>
<h1>“</h1>
<h2><strong>A knowledge-graph powered open data portal</strong></h2>
<p><a href="https://data.europarl.europa.eu/">The European Parliament Open Data Portal (EPODP)</a> went live in January 2023. Its particularity is that it is not a mere aggregation of documents or dump files from business applications in custom formats; but rather a <strong>collection of datasets each extracted from a central semantic knowledge graph</strong>, itself aggregating data migrated from approximately <strong>twenty business applications</strong>. The result is a semantically interoperable open data portal : the semantic of its data model is clearly defined and documented, and reuses widely deployed existing ontologies. It already provides its data to different consumers (most notably <a href="https://www.europarl.europa.eu/">the europarl website</a> and <a href="https://law-tracker.europa.eu/">the EU law tracker</a>) in a context of cross-institutions interoperability. The data captures the activity of the parliament : as co-legislator together with the Council of the EU, the European Parliament (EP) holds plenary sittings, in which reports originating from committees, as well as motion for resolutions, are amended and voted; after the vote, the final adopted texts are published.</p>
<p>The focus on semantic interoperability of EPODP maximizes the potential of reuse and linkage of its datasets, and <strong>maximizes the quality</strong> of the offered data. It comes however at a cost when building the portal : deep analysis and understanding of the existing data and documents structure is required to capture the business semantic. SHACL is the way to formally encode this business semantic &#8211; but how is it deployed in practice ? how is it maintained ? what are the different types of SHACL specifications used ?</p>
<h2><strong>SHACL at the center of a model-driven approach</strong></h2>
<p>SHACL in the EPODP is at the basis of multiple model-driven usages depicted in the following diagram:</p>
<p><a href="https://blog.sparna.fr/wp-content/uploads/2025/04/spec-SHACL.png"><img class="aligncenter size-large wp-image-1961" src="https://blog.sparna.fr/wp-content/uploads/2025/04/spec-SHACL-1024x508.png" alt="spec-SHACL" width="650" height="322" /></a></p>
<p>There was two key drivers for introducing the use of SHACL in the EPODP project : <strong>validation of the data</strong> in the knowledge graph, and <strong>generation of public documentations</strong> of the models. The same SHACL specification that captures the business semantic is directly actionable to be published as a documentation and to validate the data. The produced documentation is a set of public files, such as <a href="https://data.europarl.europa.eu/def/eli-ep">the ELI-EP application profile documentation</a> and others accessible from <a href="https://data.europarl.europa.eu/en/developer-corner">the EPODP developer&rsquo;s corner</a>. <a href="https://shacl-play.sparna.fr/play/doc">The SHACL Play documentation generator</a> is used to produce the documentation pages. Data validation happens at earlier stages, after data transformation steps.</p>
<p>Two additional usages of SHACL specifications were explored : one was to generate SPARQL queries to extract the content of datasets from the larger knowledge graph. The SHACL specification of a dataset content is interpreted to generate SPARQL CONSTRUCT queries, executed against the entire knowledge graph, to return a subset of data corresponding to the specification. The query generation was implemented <a href="https://shacl-play.sparna.fr/play/sparql">in SHACL Play</a>, however the EPODP chose to continue using manually crafted SPARQL queries to generate the datasets. The other usage was to complement the SHACL specifications with the mapping rules used to feed the corresponding properties or classes in the graph. This has the advantage that the mapping rules are documented and maintained alongside the specification and not in a separate document. This work is ongoing.</p>
<p>More exploratory usages of SHACL are foreseen : generating a query user interface based on the SHACL specification, <a href="https://docs.sparnatural.eu/how-to-configure-shacl/How-to-configure-Sparnatural-shacl.html">using the <strong>Sparnatural</strong> query builder</a>, and also input forms to facilitate the creation of DCAT datasets descriptions. Additionally, automated generation of the JSON-LD context and the JSON schema of the API are foreseen.</p>
<h2><strong>Not &laquo;&nbsp;1 SHACL to rule them all&nbsp;&raquo;, but application profiles, dataset definitions, and migration specifications</strong></h2>
<p>The definition of the EPODP knowledge graph is not captured in a single SHACL specification, but rather in three different application profiles, each being a selection of classes and properties of one sub-domain : <strong><a href="https://data.europarl.europa.eu/def/eli-ep">ELI-EP</a></strong> covers the description of documents and activities, <strong><a href="https://data.europarl.europa.eu/def/org-ep">ORG-EP</a></strong> covers the definitions of EP organisations (such as committees, political groups, etc.) and members of the parliament, and <strong><a href="https://europarl.github.io/skos-ep">SKOS-EP</a></strong> covers how controlled vocabularies are structured. In addition, <a href="https://data.europarl.europa.eu/def/dcat-ep">DCAT-EP</a> is the specification for how dataset records are described in the EPODP catalog &#8211; but this is not part of the knowledge graph <em>per se</em>.</p>
<p>Together, ELI-EP, ORG-EP and SKOS-EP specify the structure of the entire knowledge graph from which the datasets are extracted. In addition, the structure of each dataset family available in the EPODP (such as adopted texts, plenary documents, parliamentary questions, etc.) is also described in SHACL, referred to as <strong>&laquo;&nbsp;DSD&nbsp;&raquo; for &laquo;&nbsp;Dataset Definition&nbsp;&raquo;</strong>. While the application profiles describe every possible properties on generic shapes, the DSDs will specify only the subset of properties used in a dataset, with possibly different cardinalities or range. For example, ELI-EP specifies that <em>&laquo;&nbsp;a Work may have the property</em><em> </em><em>eli:adopts</em><em>&laquo;&nbsp;</em> (with no minimum cardinality (eli:adopts is defined as <em>&laquo;&nbsp;Indicates that the work represents the adopted work of one or several related works&nbsp;&raquo;</em>). The DSD for adopted texts datasets specifies the shape of &laquo;&nbsp;Adopted texts&nbsp;&raquo; as a subset of the Works, and indicates that the minimum cardinality of eli:adopts is 1 for this particular subset. Besides, some properties, such as eli:amends are not available for adopted texts, thus not declared in the DSD.</p>
<p>In addition, specifications of the conversion of some data sources are also specified in independent SHACL files. The articulations of these 3 kinds of SHACL files and the reused ontologies is depicted in the following diagram:</p>
<p><a href="https://blog.sparna.fr/wp-content/uploads/2025/04/3-SHACL-shapes.png"><img class="aligncenter size-large wp-image-1962" src="https://blog.sparna.fr/wp-content/uploads/2025/04/3-SHACL-shapes-1024x603.png" alt="3-SHACL-shapes" width="650" height="383" /></a></p>
<p>There is currently no reuse or reference of shapes across the different specifications. Each is independent. A nice improvement would be to study how SHACL DSDs could be derived from the application profile SHACL, without redeclaring the identical constraints.</p>
<h2><strong>Editing SHACL in spreadsheets</strong></h2>
<p>In total 16 SHACL specifications are currently published in the EPODP, and around 80 are used to validate data migrated from each individual sources. The first step in the specification of each model is the design in a diagram such as the ones visible in the public documentations of the models. The EPODP team is then using spreadsheets to encode the specifications, adapted from the one provided <a href="https://shacl-play.sparna.fr/play/shaclexcel">in the SHACL Play suite</a>. The spreadsheet is converted to SHACL using <a href="https://xls2rdf.sparna.fr/rest/">the xls2rdf converter</a>. <strong>Spreadsheets provide a simple editing solution</strong>, with an easy learning curve, made even easier with a few formulas to compute cell values automatically. It even provides ways for editing advanced patterns (such as the ability to directly turtle lists for sh:or, or blank nodes for property paths), but of course still limits the expressivity. The following screenshot shows how property shapes look like in the spreadsheet:</p>
<p><a href="https://blog.sparna.fr/wp-content/uploads/2025/04/properties-ELI.png"><img class="aligncenter size-large wp-image-1963" src="https://blog.sparna.fr/wp-content/uploads/2025/04/properties-ELI-1024x442.png" alt="properties-ELI" width="650" height="281" /></a></p>
<h2></h2>
<h2><strong>Results and future perspectives</strong></h2>
<p>The EPODP use-case shows how SHACL can be applied in a systematic way in a data integration and dissemination project : at the data transformation step, at the knowledge graph level, and at the data dissemination. <strong>Public documentation, data validation, data extraction are tasks that can be be automated based on a SHACL specification</strong>. While the context is one of a large public institution, the same approach can be applied in industrial contexts. The SHACL specifications are a cornerstone of such projects, enabling semantic interoperability at large and a mutual understanding between business experts, data analysts, developers, and data consumers.</p>
<p>&nbsp;</p>
<h1>”</h1>
<p>Veronika&rsquo;s book will be divided into three parts :<br class="html-br" /><br class="html-br" />1. Back to Basics<br class="html-br" />Introduction to logic and RDF, brief skimming of the topics. Also covering various world assumptions.</p>
<p>2. Getting to know the stuff<br class="html-br" />Introduction to SHACL, including core, sh-sparql, advanced features.</p>
<p>3. Working with the stuff<br class="html-br" />SHACL Stories. Use cases, user stories and implementations.</p>
<p><em>Image : © European Union, [2024] &#8211; EP</em></p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2025/04/09/european-parliament-open-data-portal-a-shacl-powered-knowledge-graph/">European Parliament Open Data Portal : a SHACL-powered knowledge graph</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sparna.fr/2025/04/09/european-parliament-open-data-portal-a-shacl-powered-knowledge-graph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPARNAtural : écrire des requêtes SPARQL, tout naturellement</title>
		<link>https://blog.sparna.fr/2019/06/13/sparnatural-ecrire-des-requetes-sparql-tout-naturellement/</link>
		<comments>https://blog.sparna.fr/2019/06/13/sparnatural-ecrire-des-requetes-sparql-tout-naturellement/#comments</comments>
		<pubDate>Thu, 13 Jun 2019 15:19:57 +0000</pubDate>
		<dc:creator><![CDATA[Thomas Francart]]></dc:creator>
				<category><![CDATA[Recherche d'informations]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[graphe de connaissances]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[knowledge graph]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[Sparnatural]]></category>

		<guid isPermaLink="false">http://blog.sparna.fr/?p=1258</guid>
		<description><![CDATA[<p>Sparnatural est un composant Javascript permettant  de naviguer dans un graphe de connaissances RDF en construisant visuellement des requêtes SPARQL. UPDATE avril 2021 : Sparnatural a un nouveau site web a http://sparnatural.eu ! Dans la copie d&#8217;écran ci-dessus, on demande &#171;&#160;Toutes les oeuvres exposées dans un musée Français qui expose une oeuvre du Caravage, et&#8230;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2019/06/13/sparnatural-ecrire-des-requetes-sparql-tout-naturellement/">SPARNAtural : écrire des requêtes SPARQL, tout naturellement</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><a href="https://github.com/sparna-git/Sparnatural" target="_blank"><strong>Sparnatural</strong></a> est un composant Javascript permettant  de naviguer dans un graphe de connaissances RDF en construisant visuellement des requêtes SPARQL.</p>
<p><span style="text-decoration: underline;"><strong>UPDATE avril 2021</strong> : Sparnatural a un nouveau site web a <strong><a href="http://sparnatural.eu">http://sparnatural.eu</a></strong> !</span></p>
<p>Dans la copie d&rsquo;écran ci-dessus, on demande <em>&laquo;&nbsp;Toutes les oeuvres exposées dans un musée Français qui expose une oeuvre du Caravage, et dont l&rsquo;auteur est Italien&nbsp;&raquo;</em>.</p>
<div style="width: 1569px" class="wp-caption aligncenter"><a href="https://github.com/sparna-git/Sparnatural/raw/master/documentation/screencast-sparnatural-dbpedia.gif" target="_blank"><img src="https://github.com/sparna-git/Sparnatural/raw/master/documentation/screencast-sparnatural-dbpedia.gif" alt="" width="1559" height="867" /></a><p class="wp-caption-text">Démo de Sparnatural sur DBPedia</p></div>
<p>Le screencast ci-dessus est extrait de <a href="http://labs.sparna.fr/sparnatural-demo-dbpedia/">la démo de Sparnatural paramétrée sur DBPedia</a> avec laquelle vous pouvez jouer en ligne.</p>
<p>Le développement de ce composant a été réalisé dans le cadre du projet <a href="http://openarchaeo.huma-num.fr/explorateur/" target="_blank">OpenArchaeo</a> où il est utilisé pour naviguer dans des données archéologiques. Il est autonome du projet et peut être réutilisé dans le cadre de sa license LGPL. Le code source est ouvert et il est interdit de &laquo;&nbsp;refermer&nbsp;&raquo; le code source, toute modification doit être publiée sous la même licence, et idéalement reversée dans <a href="https://github.com/sparna-git/Sparnatural" target="_blank">le dépôt Github du projet</a>.</p>
<p>Sparnatural s&rsquo;inspire en grande partie de la navigation proposée par l&rsquo;interface <a href="https://public.researchspace.org" target="_blank">ResearchSpace</a> du British Museum.</p>
<h2>Et pourquoi c&rsquo;est cool ?</h2>
<ul>
<li>Parce que ça n&rsquo;existait pas !  (en dehors de ResearchSpace, mais dont le source est en React), en tout cas pas comme un composant autonome et paramétrable</li>
<li>Parce que le composant est <strong>paramétrable</strong> à souhait pour construire des requêtes sur différentes structures de graphe, en changeant le paramétrage des classes et des propriétés; vous pouvez jeter un oeil au <a href="https://github.com/sparna-git/Sparnatural/blob/master/sparnatural-demo-dbpedia/config/spec-search-dbpedia.json" target="_blank">fichier de paramétrage de la démo</a>.</li>
<li>Parce qu&rsquo;il est orienté end-user et que, en particulier, <strong>la structure du graphe que l&rsquo;on présente à l&rsquo;utilisateur n&rsquo;est pas obligatoirement &#8211; en fait n&rsquo;est jamais &#8211; celle du graphe de données sous-jacent:</strong>
<ul>
<li>Chaque classe dans le composant peut être mappé sur un critère plus complexe (On présente à l&rsquo;utilisateur &laquo;&nbsp;Type d&rsquo;activité&nbsp;&raquo;, qui est mappé sur &laquo;&nbsp;tous les skos:Concept ayant un skos:inScheme ex:ActivityType&nbsp;&raquo;)</li>
<li>Chaque lien dans le composant peut être mappé sur une séquence de liens RDF dans le graphe (un <em>property path</em>) (Le lien &laquo;&nbsp;Musée expose oeuvre&nbsp;&raquo; dans le composant de construction de query est l&rsquo;inverse du lien RDF &laquo;&nbsp;Oeuvre dbpedia:museum Musée&nbsp;&raquo;). Typiquement le paramétrage de tous les liens inverses permet à un utilisateur d&rsquo;explorer le graphe en le prenant par n&rsquo;importe quel bout;</li>
<li>On peut limiter les types d&rsquo;objets et les types de liens que l&rsquo;on présente dans le composant pour ne permettre d&rsquo;interroger qu&rsquo;une sous-partie des données;</li>
</ul>
</li>
<li>Parce qu&rsquo;il offre <strong>plusieurs mode de sélection des valeurs</strong> :
<ul>
<li>un champ d&rsquo;autocompletion, à associer à une requête SPARQL (ou pas SPARQL) qui ira proposer des valeurs sur la base des caractères tapés dans le champs;</li>
<li>un champ de dropdown, pour les petites listes;</li>
<li>un champ de recherche texte;</li>
<li>un champ d&rsquo;input de date (début / fin);</li>
</ul>
</li>
<li>Parce que <strong>la requête peut s&rsquo;exécuter au fur et à mesure de la construction de l&rsquo;équation de recherche</strong>; pas besoin d&rsquo;appuyer sur un bouton; cela fait beaucoup pour obtenir une expérience utilisateur de découverte des données;</li>
<li>Parce que c&rsquo;est <strong>multilingue</strong> : on peut associer des libellés en plusieurs langue à chaque classe et chaque propriétés;</li>
<li>Parce que c&rsquo;est facile d&rsquo;injecter des <strong>icônes</strong> <a href="https://fontawesome.com/" target="_blank">fontawesome</a> pour illustrer chaque classe dans les menus;</li>
<li>Parce qu&rsquo;on peut post-traiter la requête après que le composant l&rsquo;a construite : ajouter la sélection de plusieurs colonnes, ajouter des préfixes, etc.</li>
<li>Parce que ça peut joliment égayer la platitude morne des formulaires de requêtes SPARQL que l&rsquo;on expose à des utilisateurs, en s&rsquo;intégrant avec <a href="http://about.yasgui.org/" target="_blank">YASGUI</a>, pour permettre une découverte intuitive des données;</li>
</ul>
<p>Le résultat, au-delà d&rsquo;un simple éditeur SPARQL, offre une vraie <strong>expérience d&rsquo;exploration des données</strong>, avec des mécanismes d&rsquo;essai-erreur, retour arrière, prise du graphe par un autre bout, etc.</p>
<h2>Limites de l&rsquo;exercice</h2>
<p>L&rsquo;objectif est d&rsquo;offrir un moyen simple et compréhensible de naviguer dans des données. En conséquence, Sparnatural n&rsquo;est capable que de construire des motifs de graphe SPARQL simple, et ne sais pas gérer les UNION, OPTIONAL, sous-select, BIND, etc.</p>
<p>Par ailleurs le composant s&rsquo;arrête à sélectionner les URIs des objets cherchés, il n&rsquo;est pas possible pour un utilisateur de choisir les colonnes présentées dans le tableau de résultats. Il faut post-traiter la requête pour injecter la sélection des valeurs de colonnes.</p>
<p>Si, comme pour la démo DBPedia, vous intégrez Sparnatural avec YASGui et YASR et que la page HTML envoie la requête SPARQL, faites attention que le service SPARQL doit supporter les requêtes CORS (Cross-Origin Resource Sharing), ce qui n&rsquo;est pas le cas de tous les services SPARQL&#8230; mais ça devrait !</p>
<h2>Envie d&rsquo;essayer ?</h2>
<p>Rendez-vous sur le <a href="https://github.com/sparna-git/Sparnatural" target="_blank">dépôt Github de Sparnatural</a> si vous voulez un peu plus de doc ou que vous voulez remonter un ticket, un bug, ou contribuer au code. D&rsquo;autres démos devraient suivre, <em>stay tuned</em> !</p>
<p>&nbsp;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2019/06/13/sparnatural-ecrire-des-requetes-sparql-tout-naturellement/">SPARNAtural : écrire des requêtes SPARQL, tout naturellement</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sparna.fr/2019/06/13/sparnatural-ecrire-des-requetes-sparql-tout-naturellement/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
