<?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; SHACL Play</title>
	<atom:link href="https://blog.sparna.fr/category/outils/shacl-play/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>2013-2023 : ‘Tis SKOSPlay!’s Birthday !</title>
		<link>https://blog.sparna.fr/2023/03/13/2013-2023-tis-skosplays-birthday/</link>
		<comments>https://blog.sparna.fr/2023/03/13/2013-2023-tis-skosplays-birthday/#comments</comments>
		<pubDate>Mon, 13 Mar 2023 14:28:53 +0000</pubDate>
		<dc:creator><![CDATA[Marie Muller]]></dc:creator>
				<category><![CDATA[Linked Data]]></category>
		<category><![CDATA[Ontologies]]></category>
		<category><![CDATA[OWL]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[SHACL]]></category>
		<category><![CDATA[SHACL Play]]></category>
		<category><![CDATA[SKOS]]></category>
		<category><![CDATA[SKOS Play]]></category>
		<category><![CDATA[Thesaurus]]></category>
		<category><![CDATA[Visualisation de données]]></category>
		<category><![CDATA[ontologie]]></category>
		<category><![CDATA[skos play]]></category>
		<category><![CDATA[thesaurus]]></category>
		<category><![CDATA[web sémantique]]></category>

		<guid isPermaLink="false">http://blog.sparna.fr/?p=1540</guid>
		<description><![CDATA[<p>Hi, it’s Marie (aka chutjetweet here). To be short I’m a documentalist, terminologist, old (linked &#8211; open) data maniac &#38; lil’ onto-Padawan and… just came to join Sparna’s team this early January ! To inaugurate my first article on Sparna’s blog, let’s share a little feedback of mine today about Sparna’s well-known SKOSPlay! whose 10 years’ birthday&#8230;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2023/03/13/2013-2023-tis-skosplays-birthday/">2013-2023 : ‘Tis SKOSPlay!’s Birthday !</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><span style="font-weight: 400;">Hi, it’s Marie (aka chutjetweet </span><a href="https://twitter.com/chutjetweet"><span style="font-weight: 400;">here</span></a><span style="font-weight: 400;">). To be short I’m a documentalist, terminologist, old (linked &#8211; open) data maniac &amp; lil’ onto-Padawan and… just came to join Sparna’s team this early January !</span></p>
<p><span style="font-weight: 400;">To inaugurate my first article on Sparna’s blog, let’s share a little feedback of mine today about Sparna’s well-known </span><a href="https://skos-play.sparna.fr/play/"><span style="font-weight: 400;">SKOSPlay!</span></a><span style="font-weight: 400;"> whose 10 years’ birthday is to celebrate this year !</span></p>
<p><span style="font-weight: 400;">10 yo, quite a historic tool ! but more than ever actual in a context where the semantic technologies get front of the scene anew due to growing interest shown by the digital humanities movement to data interoperability projects via the standardized knowledge structuration (Wikipedia-Wikidata projects e.g., as semantic wiki devices), and also due to the last progress of artificial intelligence, now able to processing large amount of data and </span><a href="https://www.epimorphics.com/writing-ontologies-with-chatgpt/"><span style="font-weight: 400;">soon fully leveraging the potential of ontologies and knowledge graphs</span></a><span style="font-weight: 400;">.</span></p>
<table>
<tbody>
<tr>
<td><i><span style="font-weight: 400;"><a href="https://twitter.com/taxobob/status/1615594349512851456"><img class="alignnone wp-image-1561 size-full" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image5.png" alt="image5" width="878" height="321" /></a></span></i><em><span style="font-weight: 400;">From asking for a taxonomy </span><a href="https://twitter.com/mommi84/status/1631027355987656706"><span style="font-weight: 400;">to querying RDF files with an API</span></a><span style="font-weight: 400;">…</span></em></td>
</tr>
</tbody>
</table>
<p><span style="font-weight: 400;">This said, in a more practical way, semantic web standards are not always easy to manipulate as a professional &#8211; if non-initiate to SPARQL and nor confirmed data scientist, and even when you have got to deal with a simple structured list of terms !</span></p>
<p><span style="font-weight: 400;">Either your data is already SKOS-standardized (great !), there sometimes come to have a gap between normalization step and visualization step that requires a bit more technical IT skills. Either &#8211; most of time &#8211; the common muggle-born is to start with a plain Excel spreadsheet, create a list, add some hierarchy, maybe other scope notes or definitions and&#8230; end far puzzled wondering how to </span><span style="font-weight: 400;">get </span><a href="https://www.w3.org/DesignIssues/diagrams/lod/597992118v2_350x350_Back.jpg"><span style="font-weight: 400;">a 5-star data vocabulary</span></a><span style="font-weight: 400;"> ⭐ !</span></p>
<p>&nbsp;</p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image14.gif"><img class="alignnone size-full wp-image-1577" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image14.gif" alt="image14" width="500" height="208" /></a></p>
<p>&nbsp;</p>
<p><strong>A SKOSPlay!-within-a-SKOSPlay!</strong></p>
<table>
<tbody>
<tr>
<td><a href="https://twitter.com/belett/status/1583128873877008384"><img class="alignnone wp-image-1565 size-full" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image3.png" alt="image3" width="886" height="359" /></a><em><span style="font-weight: 400;">Wink to <a href="https://twitter.com/belett">@belett</a>, anything possible now with SKOSPlay!</span></em></td>
</tr>
</tbody>
</table>
<p><span style="font-weight: 400;">Aiming at visualizing (and printing !) SKOS thesauri, taxonomies and vocabularies at the very beginning, SKOSPlay! is a full online free and open source tool leveraging semantic technologies (RDF, SPARQL, inference, Linked Data) to generate downloadable HTML or PDF documents. More and more new features have been added since then : alignments display, OWL and SKOS-XL files processing, autocomplete fields and permuted indexes generating …</span></p>
<table>
<tbody>
<tr>
<td><a href="https://twitter.com/veronikaheim/status/1612375648948846592"><img class="alignnone size-full wp-image-1566" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image7.png" alt="image7" width="884" height="237" /></a><em><span style="font-weight: 400;">Hello <a href="https://twitter.com/veronikaheim">@veronikaheim</a>, maybe SKOSPlay! could match your need ?</span></em></td>
</tr>
</tbody>
</table>
<p><span style="font-weight: 400;">… among other nice and useful developments.</span></p>
<p><span style="font-weight: 400;">But as an Excel aficionada, the one that I prefer is </span><a href="https://skos-play.sparna.fr/play/convert?lang=en"><span style="font-weight: 400;">the Excel-to-RDF converter tool</span></a><span style="font-weight: 400;">.</span></p>
<p><span style="font-weight: 400;">One sheet. One import. One result. Easy-peasy, happy terminologist :))</span></p>
<p><span style="font-weight: 400;">(And you can even keep your custom colors templates and formats !!! </span><span style="font-weight: 400;">🦄</span><span style="font-weight: 400;"> )</span></p>
<p>&nbsp;</p>
<p><strong>Come on &amp; let’s SKOSPlay!</strong></p>
<p><span style="font-weight: 400;">Let&rsquo;s figure out you want to display or construct a small vocabulary you could quickly visualize in a standardized SKOS-structured way :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image10-2.png"><img class="alignnone size-full wp-image-1607" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image10-2.png" alt="image10-2" width="1657" height="1079" /></a></p>
<p><span style="font-weight: 400;">Now to fit in the SKOS model your data has to follow </span><a href="https://skos-play.sparna.fr/play/excel_test/excel2skos-exemple-1.xlsx"><span style="font-weight: 400;">a particular template</span></a><span style="font-weight: 400;"> you can fullfill by downloading on SKOSPlay! website.</span></p>
<p><span style="font-weight: 400;">First you have to define </span><a href="https://skos-play.sparna.fr/play/convert#excel-file-structure"><span style="font-weight: 400;">the header of the template</span></a><span style="font-weight: 400;"> : the global scheme of your vocabulary, its URI, title and description :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image12.png"><img class="alignnone size-full wp-image-1575" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image12.png" alt="image12" width="1347" height="189" /></a></p>
<p><span style="font-weight: 400;">Adding the terms of your list (with the URIs)… Here with the “@en” language indication on top of the column </span><a href="https://skos-play.sparna.fr/play/convert#languages"><span style="font-weight: 400;">as I am to create an English-French multilingual vocabulary</span></a><span style="font-weight: 400;"> :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image15.png"><img class="alignnone size-full wp-image-1578" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image15.png" alt="image15" width="1509" height="1021" /></a></p>
<p><span style="font-weight: 400;">Recreating the arborescent structure through the Excel template (don’t mind my color palette, I always like colouring my Excel sheets to better visualize the info at a glance !).</span></p>
<p><span style="font-weight: 400;">The hierarchical broader-narrower structure is to be recreated </span><a href="https://skos-play.sparna.fr/play/convert#sheet-body"><span style="font-weight: 400;">by adding a “skos:narrower” column</span></a><span style="font-weight: 400;"> (or skos:broader, as you want, with only 1 broader value per line) where you will list the different specific values front of the more generic one (separated by comas). Here I used a PREFIX too in order to shorten my http:// URIs, SKOSPlay! can process them anyway !</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image9.png"><img class="alignnone size-full wp-image-1572" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image9.png" alt="image9" width="1943" height="1431" /></a></p>
<p><span style="font-weight: 400;">Then adding a few notes and other information (multilingual values, skos:notation, any other default properties known in the converter (</span><a href="https://skos-play.sparna.fr/play/convert#prefixes"><span style="font-weight: 400;">see the documentation</span></a><span style="font-weight: 400;">) or different custom elements of yours by adding other PREFIXes :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image4.png"><img class="alignnone size-full wp-image-1569" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image4.png" alt="image4" width="1999" height="1269" /></a></p>
<p><span style="font-weight: 400;">Your Excel template is ready to go ! quite an easy configuration in my demo here, but SKOSPlay! can also deal with skos:Collections, SKOS-XL and other </span><a href="https://skos-play.sparna.fr/play/convert#advanced-features"><span style="font-weight: 400;">advanced RDF structures</span></a><span style="font-weight: 400;"> : blank nodes, RDF lists, named graphs. And now possible to generate OWL and SHACL files with the converter too !</span></p>
<p><span style="font-weight: 400;">Now it’s time to turn your (finally-not-so-dirty-<img src="https://s.w.org/images/core/emoji/72x72/1f438.png" alt="🐸" class="wp-smiley" style="height: 1em; max-height: 1em;" />) data into a SKOS-charming file. Take your favorite </span><del><span style="font-weight: 400;">magic wand</span></del><span style="font-weight: 400;"> SKOSPlay! </span><a href="https://skos-play.sparna.fr/play/convert"><span style="font-weight: 400;">Excel-to-RDF converter tool</span></a><span style="font-weight: 400;"> and load your Excel file in it (adding some optional parameters if needed).</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image8.png"><img class="alignnone size-full wp-image-1571" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image8.png" alt="image8" width="1601" height="885" /></a></p>
<p><span style="font-weight: 400;">Well done, it’s a wonderful RDF-ized vocabulary file (here in a Turtle format but you have also RDF/XML, N-Triples, N-Quads, N3 and TriG available) :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image1.png"><img class="alignnone size-full wp-image-1567" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image1.png" alt="image1" width="1617" height="1029" /></a></p>
<p>&nbsp;</p>
<p><strong>Wingardium Visualiza !</strong></p>
<p>We&rsquo;re almost done. <span style="font-weight: 400;">Go back to the website, </span><a href="https://skos-play.sparna.fr/play/upload"><span style="font-weight: 400;">tab “Play!”</span></a><span style="font-weight: 400;">, load your last RDF-serialized file and go to the next step to chose the kind of display you want to get, endly press (SKOS)Play! and … abracadataaaaaaa !</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image2.png"><img class="alignnone size-full wp-image-1568" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image2.png" alt="image2" width="1657" height="1197" /></a></p>
<p><span style="font-weight: 400;">Many different options to visualize your arborescent data. Tree, static and dynamic, but also more « professional » and printable sorts of displays like alphabetical, hierarchical or permuted views :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image6.png"><img class="alignnone size-full wp-image-1570" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image6.png" alt="image6" width="1999" height="1361" /></a></p>
<p><span style="font-weight: 400;">And KWIC (as for « </span><span style="font-weight: 400;">KeyWord In Context ») :</span></p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2023/03/image13.png"><img class="alignnone size-full wp-image-1576" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image13.png" alt="image13" width="1999" height="937" /></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Even possible to load an online Google spreadsheet (</span><a href="https://docs.google.com/spreadsheets/d/1MpN4tzd7S7m7Dnr7IFOz43YoWcSYqUG1/edit?usp=share_link&amp;ouid=118425122592371390359&amp;rtpof=true&amp;sd=true"><span style="font-weight: 400;">mine is shared here</span></a><span style="font-weight: 400;">), just by adapting a little its URL for the converter’s need. Interesting feature in a collaborative purpose when you are team-building a vocabulary !</span></p>
<p><span style="font-weight: 400;">The whole pack </span><a href="https://skos-play.sparna.fr/play/convert#documentation"><span style="font-weight: 400;">fully documented</span></a><span style="font-weight: 400;"> and findable on Sparna’s </span><a href="https://skos-play.sparna.fr/play/"><span style="font-weight: 400;">website</span></a><span style="font-weight: 400;"> &amp; </span><a href="https://github.com/sparna-git/skos-play"><span style="font-weight: 400;">Git</span></a><span style="font-weight: 400;">. Some recent users even produced a </span><a href="http://blog.sparna.fr/2021/06/30/fair-data-collective-is-doing-cool-things-with-skos-play-and-xls2rdf/"><span style="font-weight: 400;">short video tutorial</span></a><span style="font-weight: 400;"> to show what they managed to do with different SKOSPlay! visualization tools.</span></p>
<p><span style="font-weight: 400;">Already knew about SKOSPlay! ? go see his little brother, </span><a href="https://shacl-play.sparna.fr/play/home;jsessionid=40BBB04DA1F3DCC1EBFB084A08EE2924?lang=en"><span style="font-weight: 400;">SHACLPlay!</span></a><span style="font-weight: 400;"> and feel free to give us some feedback in the comments <img src="https://blog.sparna.fr/wp-includes/images/smilies/simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span></p>
<p><span style="font-weight: 400;">Happy Birthday SKOSPlay! &amp; Long live Semantic Web !</span></p>
<p><span style="font-weight: 400;">A bit more Vouvray with your nougat de Tours ?</span></p>
<p><a href="https://www.my-loire-valley.com/2018/06/top-10-des-specialites-gourmandes-de-touraine/"><img class="alignnone size-full wp-image-1574" src="http://blog.sparna.fr/wp-content/uploads/2023/03/image11.png" alt="image11" width="1280" height="939" /></a></p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2023/03/13/2013-2023-tis-skosplays-birthday/">2013-2023 : ‘Tis SKOSPlay!’s Birthday !</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/2023/03/13/2013-2023-tis-skosplays-birthday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean JSON(-LD) from RDF using Framing</title>
		<link>https://blog.sparna.fr/2022/07/20/clean-json-ld-from-rdf-using-framing/</link>
		<comments>https://blog.sparna.fr/2022/07/20/clean-json-ld-from-rdf-using-framing/#comments</comments>
		<pubDate>Wed, 20 Jul 2022 06:56:36 +0000</pubDate>
		<dc:creator><![CDATA[Thomas Francart]]></dc:creator>
				<category><![CDATA[Linked Data]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[SHACL Play]]></category>
		<category><![CDATA[Framing]]></category>
		<category><![CDATA[json-ld]]></category>

		<guid isPermaLink="false">http://blog.sparna.fr/?p=1462</guid>
		<description><![CDATA[<p>Say you have a nice RDF knowledge graph based on an ontology, or maybe reusing ontologies, and maybe you have specified the structure of the knowledge graph with SHACL. And now you would like to expose your RDF in JSON in an API, for the average developer (or maybe you would like to produce a&#8230;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2022/07/20/clean-json-ld-from-rdf-using-framing/">Clean JSON(-LD) from RDF using Framing</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Say you have a nice RDF knowledge graph based on an ontology, or maybe reusing ontologies, and maybe you have specified the structure of the knowledge graph with SHACL. And now you would like to <strong>expose your RDF in JSON</strong> in an API, for the average developer (or maybe you would like to produce a clean JSON to be indexed by Elastic). And the average developer (or Elastic) does not care about RDF and does not care about the “-LD” in “JSON-LD”, he just cares about JSON; and he is right ! we are here to care about the “-LD” part for him.</p>
<p>So what you need is to produce a clean JSON structure from your raw RDF triples. And when I mean “clean”, I mean :</p>
<ul>
<li><strong>no URIs</strong>. Nowhere. No URIs in JSON keys, No URIs in types of entities, no URIs in the value of properties controlled by a closed list; the only places where it is acceptable to see a URI are : to give the id of the entities, and when making a reference to such an id of entity within the graph; even in these cases the URIs can be shortened.</li>
<li><strong>no fancy JSON-LD keys</strong> like @type, @value, @datatype, @id, etc.</li>
<li><strong>indented</strong>.</li>
</ul>
<p>You have 2 possibilities to do that :</p>
<ol>
<li>You develop a custom script, to either generate a JSON export of your data, or to implement the API that will query the knowledge graph, parse the triples, and generate that clean JSON output.</li>
<li>You use <strong><a href="https://www.w3.org/TR/json-ld11-framing/">JSON-LD framing</a> to automate the production of a clean JSON(-LD) from RDF</strong>.</li>
</ol>
<p>There are 2 nice things about the solution with JSON-LD framing :</p>
<ol>
<li>it can be automated</li>
<li>you automatically retain the RDF compatibility &#8211; because your JSON will necessarily be JSON-LD. This means you can import your nice JSON directly in a triplestore.</li>
</ol>
<p>The principle of JSON-LD framing is that you provide a <a href="https://www.w3.org/TR/json-ld/#the-context">JSON-LD @context </a>with an additionnal <a href="https://www.w3.org/TR/json-ld11-framing/#framing">frame specification</a> that defines how the JSON should be structured (indented), which entity to include at each level (entities can be filtered based on some criteria), and also which properties to include in each entity.</p>
<p>To start with JSON-LD framing, what you need is JSON-LD. Any JSON-LD. Typically the raw JSON-LD serialization that any RDF library or triplestore will produce; that kind of ugly, messy, full-of-URIs-and-@language kind of JSON. So something like:</p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2022/07/Capture-d’écran-du-2022-07-19-17-30-45.png"><img class="aligncenter size-large wp-image-1465" src="http://blog.sparna.fr/wp-content/uploads/2022/07/Capture-d’écran-du-2022-07-19-17-30-45-1024x658.png" alt="Capture d’écran du 2022-07-19 17-30-45" width="650" height="418" /></a></p>
<p><em>(Brrr, scary, no ?)</em></p>
<p>And then what you need is the <a href="https://json-ld.org/playground/">JSON-LD playground</a> with the “Framed” tab. This will allow you to test your context and frame specification.</p>
<p>And when deployed in production, what you will need is a JSON-LD library that is capable of implementing the JSON-LD framing algorithm. Implementations are listed <a href="https://json-ld.org/#developers">here</a>, and you need an implementation compatible with JSON-LD 1.1.</p>
<h2>Example files</h2>
<p>As an example, I use a JSON-LD file from the French National Library, the one from Les Misérables here : <a href="https://data.bnf.fr/fr/13516296/victor_hugo_les_miserables/">https://data.bnf.fr/fr/13516296/victor_hugo_les_miserables/</a> (download link at the bottom of the page).</p>
<p><strong>You can download <a href="http://blog.sparna.fr/wp-content/uploads/2022/07/les_miserables_jsonld_framing_example.zip">the initial JSON example, the frame specification, and the result in a zip</a>.</strong> The zip also contains intermediate frame specifications.</p>
<h2>The @context</h2>
<p>We&rsquo;ll start by specifying the JSON-LD context part.</p>
<h3><b>Map @type to type and @id to id</b></h3>
<p>Average developer will wonder what are those @type and @id keys. Re-map them straight away to type and id:</p>
<blockquote><p><code>"type" : "@type",<br />
"id" : "@id",<br />
</code></p></blockquote>
<p>Schema.org and lot of other specifications do that.</p>
<h3><b>What about @graph ?<br />
</b></h3>
<p>If you have a named graph at the top, introduced by @graph, my suggestion would be to simply remap it to a fixed key, like &laquo;&nbsp;data&nbsp;&raquo;, or &laquo;&nbsp;entities&nbsp;&raquo; :</p>
<blockquote><p><code>"data" : "@graph",<br />
</code></p></blockquote>
<h3><b>Map RDF properties URIs to JSON keys</b></h3>
<p>Get rid of any trace of URI or short URIs in JSON keys. Declare a term for every property in your graph. The simplest way to do this is to use the local part of the URI (after last “#” or “/”) as the term. Order the context by the alphabetical order of the terms. Terms for properties will usually start with a lowercase letter.</p>
<p>In corner cases you may end up with the same term (such as in the example bnf-onto:subject and dcterms:subject), so in that case you need a different key, I chose “bnf-subject” here for bnf-onto:subject and kept “subject” for dcterms:subject.</p>
<blockquote><p><code>"creator" : "dcterms:creator",<br />
"date" : "dcterms:date",<br />
"dateOfWork" : "rdagroup1elements:dateOfWork",<br />
"depiction" : "foaf:depiction",<br />
"description" : "dcterms:description",<br />
</code></p></blockquote>
<h3><b>Map classes URIs to JSON terms</b></h3>
<p>Now you want to do the same thing to get rid of any trace of URIs in the “type” of entities. Declare a term for every class in your ontology/application profile. List the classes in a different section than the properties. Terms for classes will usually start with an uppercase.</p>
<blockquote><p><code>"Concept" : "skos:Concept",<br />
"Document" : "foaf:Document",<br />
"ExpositionVirtuelle" : "bnf-onto:ExpositionVirtuelle",<br />
</code></p></blockquote>
<h3> <b>Declare object properties with “@type”: “@id”</b></h3>
<p>Now you want to get rid of all those ugly “id”, we are only interested in listing the values. To do that, modify the mapping of the property (here “depiction”) to state its values are URIs. You need to change the mapping from</p>
<blockquote><p><code>"depiction" : "foaf:depiction",</code></p></blockquote>
<p>to</p>
<blockquote><p><code>"depiction" : { "@value" : "foaf:depiction", "@type":"@id" },</code></p></blockquote>
<p>And so parts like this :</p>
<blockquote><p><code>"depiction": [<br />
{<br />
"id": "https://gallica.bnf.fr/ark:/12148/btv1b8438568p.thumbnail"<br />
},<br />
{<br />
"id": "https://gallica.bnf.fr/ark:/12148/btv1b9004781d.thumbnail"<br />
},<br />
{<br />
"id": "https://gallica.bnf.fr/ark:/12148/bpt6k5545348q.thumbnail"<br />
}<br />
]</code></p></blockquote>
<p>Will be turned into</p>
<blockquote><p><code> "depiction": [<br />
"https://gallica.bnf.fr/ark:/12148/btv1b8438568p.thumbnail",<br />
"https://gallica.bnf.fr/ark:/12148/btv1b9004781d.thumbnail",<br />
"https://gallica.bnf.fr/ark:/12148/bpt6k5545348q.thumbnail",<br />
"https://gallica.bnf.fr/ark:/12148/btv1b8438570r.thumbnail"<br />
]</code></p></blockquote>
<h3><b>Map datatypes</b></h3>
<p>Now you want to get rid of the @datatype information for literals. If the value of a property always uses the same datatype, which is the case 99,9% of the time, then you can change the mapping from</p>
<blockquote><p><code>"property" : "http://myproperty",</code></p></blockquote>
<p>to</p>
<blockquote><p><code>"property" : { “@id”: "http://myproperty", “@type”:”xsd:date” }</code></p></blockquote>
<p>(The example used does not have datatype properties.)</p>
<h3><b>Map languages, with fixed language or when multilingual</b></h3>
<p>Now let’s get rid of the @language. For this you have 2 choices : when the language is always the same for the value, you can indicate it in the context, the same way that you would do for the datatype but with the @language key. So you change from</p>
<blockquote><p><code>"description" : "dcterms:description",</code></p></blockquote>
<p>to</p>
<blockquote><p><code>"description" : { “@id” : "dcterms:description", “@language” : “fr” }</code></p></blockquote>
<p>You could even have different terms for different languages, such as :</p>
<blockquote><p><code>"title_fr" : { "@id" : "dcterms:title", "@language" : "fr" },<br />
"title_en" : { "@id" : "dcterms:title", "@language" : "en" },<br />
"title" : { "@id" : "dcterms:title" },</code></p></blockquote>
<p>or when you have multilingual multiple values, you can make the property a language map by declaring it this way:</p>
<blockquote><p><code>"editorialNote" : { "@id" : "skos:editorialNote", "@container" : "@language" },</code></p></blockquote>
<p>Which will turn the language code as a key in the JSON output:</p>
<blockquote><p><code>"editorialNote": {<br />
"fr": [<br />
"BN Cat. gén. (sous : Hugo, comte Victor-Marie) : Les misérables. - . - BN Cat. gén. 1960-1969 (sous : Hugo, Victor) : idem. - . -",<br />
"Laffont-Bompiani, Oeuvres, 1994. - . - GDEL. - . -"<br />
]
},</code></p></blockquote>
<p>In that case, watch out for cases where there is a value without language, it will generate a @none key.</p>
<h3><b>Map controlled list values to JSON terms</b></h3>
<p>By now you already get a much cleaner JSON and almost all “unnecessary” URIs have disappeared. But we still have some URI references that we can clean up : the ones that are references to controlled lists with a finite number of values.</p>
<p>We can declare term mappings for those values just like we did to map properties and classes. BUT &#8211; and this is the trick, <strong>we need to change the property declaration from “@id” to “@vocab” for the replacement to happen</strong>. This is documented in the <a href="https://www.w3.org/TR/json-ld/#type-coercion">&laquo;&nbsp;Type coercion&nbsp;&raquo; section of the spec</a>.</p>
<p>In our example, the mapping to languages and subjects are good candidates to be mapped to JSON terms. So we change</p>
<blockquote><p><code>"language" : { "@id" : "dcterms:language", "@type":"@id" },<br />
"subject" : { "@id" : "dcterms:subject", "@type":"@id" },<br />
</code></p></blockquote>
<p>to</p>
<blockquote><p><code>"language" : { "@id" : "dcterms:language", "@type":"@vocab" },<br />
"subject" : { "@id" : "dcterms:subject", "@type":"@vocab" },<br />
“fre” : “http://id.loc.gov/vocabulary/iso639-2/fre”,<br />
“eng” : “http://id.loc.gov/vocabulary/iso639-2/eng”,</code></p></blockquote>
<h3><b>Shorten remaining URI references<br />
</b></h3>
<p>Now the only URIs left are the ids of the main entities in our graph, and references to those ids. Reference to controlled vocabularies with a limited number of values have been mapped to JSON terms. Although we cannot turn all the remaining URIs to JSON terms (because we can&rsquo;t declare all possible entity URIs in the context), we can shorten them by adding a prefix mapping in the context, in our case:</p>
<blockquote><p><code>"ark-https": "https://data.bnf.fr/ark:/12148/",<br />
</code></p></blockquote>
<p>(I note that there are http:// and https:// URIs in the data, I don&rsquo;t know why)</p>
<p>&nbsp;</p>
<h2>The frame specification</h2>
<p>So now we have clean values, no URIs, no fancy JSON-LD keys. But we still don’t have a structure indented the way the average developer would expect it; and this is where the frame specification comes into play.</p>
<h3><b>Define indentation and filters (and reverse properties if needed)<br />
</b></h3>
<p>The frame specification acts as both a filter/selection mechanism and as a structure definition. At each level you indicate the criterias for the object to be included. In our example we have a skos:Concept (the entry in the library catalog) that is foaf:focus a Work (the Book &laquo;&nbsp;in the real world&nbsp;&raquo;), and that skos:Concept is the subject of many virtual exhibits. We want to have the Concept and the Work at first level, and under the concept the exhibits. But there is a trick : it is the virtual exhibits that points to the concept with a dcterms:subject, and we want it the other direction : Concept is_subject_of Exhibit, so we need a @reverse property.</p>
<p>To do that, add the following reverse mapping declaration: (don&rsquo;t modify the existing one):</p>
<blockquote><p><code>"subject_of" : { "@reverse" : "dcterms:subject" },</code></p></blockquote>
<p>Note the use of &laquo;&nbsp;@reverse&nbsp;&raquo; to indicate that JSON key is to be interpreted from object to subject when turned into triples.</p>
<p>With that in place, we can write our frame specification, which goes right after the @context we have designed before:</p>
<blockquote><p><code>"type" : ["Concept", "Work"],<br />
"subject_of" : {<br />
"type" : "ExpositionVirtuelle"<br />
}</code></p></blockquote>
<p>Note how we use the terms defined in the context previously. This is to be understood the following way : <em>&laquo;&nbsp;at the first level, take any entity with a type of either Concept or Work, then insert a subject_of key and put inside any value that has a type ExpositionVirtuelle&nbsp;&raquo;</em>. This garantees the virtual exhibits objects will go under the Concept, and not above or at the same level. But this is not sufficient, as you will notice if you apply that framing that the Work is <strong>repeated</strong> under the &laquo;&nbsp;focus&nbsp;&raquo; property of the Concept, and at the root level. This is because of the default behavior of the JSON-LD playground regarding <a href="https://www.w3.org/TR/json-ld11-framing/#object-embed-flag">object embedding</a> (objects are always embeded when they are referenced)</p>
<h3><b>Avoid embedding</b></h3>
<p>To avoid embedding when it is undesired, we can set the &laquo;&nbsp;@embed&nbsp;&raquo; option to &laquo;&nbsp;@never&nbsp;&raquo; on the &laquo;&nbsp;focus&nbsp;&raquo; property, like so :</p>
<blockquote><p><code>"type" : ["Concept", "Work"],<br />
"subject_of" : {<br />
"type" : "ExpositionVirtuelle"<br />
},<br />
"focus" : {<br />
"@embed" : "@never",<br />
"@omitDefault": true<br />
}<br />
</code></p></blockquote>
<p>This tells the framing algorithm to never embed the complete entity inside the focus property, just reference the URI instead.</p>
<p>Also, you will notice the use of &laquo;&nbsp;@omitDefault&nbsp;&raquo; to true; this tells the framing algorithm to omit the focus property when it has no value. Otherwise, since the Work does not have a foaf:focus property (only the Concept), then it will get a &laquo;&nbsp;focus&nbsp;&raquo; key set to null.</p>
<h3><b>What about order of keys in the JSON ?</b></h3>
<p>Well, I am sure this can be controlled, either by specifying explicitely all the keys you want, in the order you want them, in the frame specification, or by using an &laquo;&nbsp;ordered&nbsp;&raquo; parameter to the JSON-LD API, but that is not available in the playground.</p>
<p>If you list all keys explicitely in the frame specification, don&rsquo;t forget to use wildcards so that any value will match; wildcards are empty objects with &laquo;&nbsp;{}&nbsp;&raquo;:</p>
<blockquote><p><code>"myProperty" : {}</code></p></blockquote>
<h2>The result</h2>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2022/07/Capture-d’écran-du-2022-07-20-08-01-19.png"><img class="aligncenter size-full wp-image-1475" src="http://blog.sparna.fr/wp-content/uploads/2022/07/Capture-d’écran-du-2022-07-20-08-01-19.png" alt="Capture d’écran du 2022-07-20 08-01-19" width="806" height="360" /></a></p>
<p>Much nicer no ? This is something you can put into the hand of an average developer.</p>
<h2>Automate context generation from SHACL</h2>
<p>Do you have a SHACL specification of the structure of your graph ? wouldn&rsquo;t it be nice to automate the generation of the JSON-LD context from SHACL ? Maybe we could do that in <a href="https://shacl-play.sparna.fr/play/">SHACL-Play</a> ? stay tuned !</p>
<p>Probably what we can automate is the context part, which can be global and unique for all your graph, but the framing specification should probably be different for each different API you need; each framing specification will then reference the same context by its URL.</p>
<p><em>Image : <a href="https://gallica.bnf.fr/ark:/12148/btv1b53230250h/f1.item.r=encadrement.zoom#"><span class="title">[Encadrement ornemental] ([1er état]) / .Io. MIGon 1544. [Jean Mignon] ; [d&rsquo;après Le Primatice]</span></a> <a href="https://gallica.bnf.fr/ark:/12148/btv1b53230250h">https://gallica.bnf.fr/ark:/12148/btv1b53230250h</a></em></p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2022/07/20/clean-json-ld-from-rdf-using-framing/">Clean JSON(-LD) from RDF using Framing</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/2022/07/20/clean-json-ld-from-rdf-using-framing/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SHACL Play! free online SHACL validator for RDF data</title>
		<link>https://blog.sparna.fr/2020/03/11/shacl-play-online-shacl-rdf-validator/</link>
		<comments>https://blog.sparna.fr/2020/03/11/shacl-play-online-shacl-rdf-validator/#comments</comments>
		<pubDate>Wed, 11 Mar 2020 14:00:37 +0000</pubDate>
		<dc:creator><![CDATA[Thomas Francart]]></dc:creator>
				<category><![CDATA[SHACL]]></category>
		<category><![CDATA[SHACL Play]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.sparna.fr/?p=1301</guid>
		<description><![CDATA[<p>SHACL Play! at http://shacl-play.sparna.fr/ is a free online RDF validator based on SHACL. It encapsulates TopQuadrant&#8217;s Java SHACL implementation as the actual validation engine. The code of SHACL Play is available on Github. Give the input RDF data to be validated, by uploading an RDF file, pointing to a URL, or copy/pasting inline data; Give the&#8230;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2020/03/11/shacl-play-online-shacl-rdf-validator/">SHACL Play! free online SHACL validator for RDF data</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><strong>SHACL Play!</strong> at <strong><a href="http://shacl-play.sparna.fr/">http://shacl-play.sparna.fr/</a></strong> is a free online RDF validator based on <a href="https://www.w3.org/TR/shacl/">SHACL</a>. It encapsulates <a href="https://github.com/TopQuadrant/shacl">TopQuadrant&rsquo;s Java SHACL implementation</a> as the actual validation engine. The code of SHACL Play is <a href="https://github.com/sparna-git/shacl-play">available on Github</a>.</p>
<ol>
<li>Give the input RDF data to be validated, by uploading an RDF file, pointing to a URL, or copy/pasting inline data;</li>
<li>Give the SHACL rules to use for validation, by uploading a file, pointing to a URL, copy/pasting inline data, or selecting the shapes from the catalog (see below);</li>
<li>Validate, and get a human-readable report generated from the <a href="https://www.w3.org/TR/shacl/#validation-report">SHACL raw validation report</a>;</li>
<li>Access to the report in its RDF or CSV variant;</li>
</ol>
<p>Here is a screenshot of how the validation report looks like :</p>
<p><a href="http://blog.sparna.fr/wp-content/uploads/2020/03/shacl-play-validation-report.png"><img class="aligncenter size-large wp-image-1305" src="http://blog.sparna.fr/wp-content/uploads/2020/03/shacl-play-validation-report-1024x603.png" alt="shacl-play-validation-report" width="650" height="383" /></a></p>
<p><strong>SHACL Play!</strong> features :</p>
<ol>
<li><strong>Free, no registration required, no limit</strong>;</li>
<li>Easy-to-use <strong>input form</strong>;</li>
<li><strong>Multiple RDF serialisations</strong> supported (Turtle, RDF/XML, n3, TriG);</li>
<li><strong>Versatile input methods</strong> for both RDF data and SHACL rules (upload, URL, copy/paste, catalog);</li>
<li><strong>Human-readable validation report</strong>, for quick analysis of the issues to be fixed in the data (or adjusted in the shapes);</li>
<li><strong>Downloadable validation reports</strong> in CSV or raw RDF;</li>
<li><strong>Asynchronous validation</strong> to avoid timeouts, for large datasets (greater than 100000 triples);</li>
<li><strong>Permalinks</strong> to validation reports when both RDF dataset and SHACL rules are online;</li>
<li><strong>Catalog of online public shapes</strong> for documentation and quick validation (see below);</li>
</ol>
<p>SHACL Play also features a command-line variant (see the <a href="https://github.com/sparna-git/shacl-play/wiki">documentation on the Github wiki</a>).</p>
<p>Future features could include :</p>
<ol>
<li>Improved display of validation report, with possibly different styles of report (depending on the &laquo;&nbsp;styles&nbsp;&raquo; of the Shapes):</li>
<li>Human-readable display of a SHACL graph;</li>
<li>Online data transformation engine based on <a href="https://www.w3.org/TR/shacl-af/">SHACL Rules</a>, with a first focus on converting an OWL ontology to SHACL constraints (see this <a href="https://www.topquadrant.com/from-owl-to-shacl-in-an-automated-way/">excellent description of one possible set of rules to derive SHACL shapes from an OWL ontology</a>, by Irene Polikoff from TopQuadrant);</li>
</ol>
<p>&nbsp;</p>
<h3>The Shapes Catalog</h3>
<p>SHACL Play includes a <a href="http://shacl-play.sparna.fr/catalog">catalog of online Shapes</a>. The catalog is collaboratively editable by modifying the <a href="https://github.com/sparna-git/SHACL-Catalog/blob/master/shacl-catalog.ttl">Shapes Catalog source file on Github</a>, through pull requests.</p>
<p>Adding an entry to the catalog allows to:</p>
<ul>
<li>See the shapes listed in the catalog page;</li>
<li>Get a form to directly validate data against these Shapes, e.g. if you want to validate your Shapes against &laquo;&nbsp;SHACL for SHACL&nbsp;&raquo; you can go to <a href="http://shacl-play.sparna.fr/validate?shapes=shsh">http://shacl-play.sparna.fr/validate?shapes=shsh</a>;</li>
<li>Get a direct permaling to the validation report if the validated RDF data is also online, so there even no need to submit anything through a form to get a validation report. e.g. <a href="http://shacl-play.sparna.fr/validate?shapes=shaclplay-catalog&amp;url=https://raw.githubusercontent.com/sparna-git/SHACL-Catalog/master/shacl-catalog.ttl">http://shacl-play.sparna.fr/validate?shapes=shaclplay-catalog&amp;url=https://raw.githubusercontent.com/sparna-git/SHACL-Catalog/master/shacl-catalog.ttl</a> is the direct link for the validation of the <a href="https://github.com/sparna-git/SHACL-Catalog/blob/master/shacl-catalog.ttl">Shapes Catalog source file</a> against the <a href="http://shacl-play.sparna.fr/resources/shapes/shacl-play-shapes-catalog.ttl">Shapes Catalog SHACL file</a>;</li>
</ul>
<h3>Another SHACL Validator</h3>
<p>Another SHACL validator is the SHACL playground is at <a href="https://shacl.org/playground/">https://shacl.org/playground/</a>. However the UI is too technical for newcomers, and it relies on a Javascript validator in the browser, thus I am not sure it would be capable of validating large Datasets.</p>
<h3>How to edit/create SHACL rules ?</h3>
<p>You need to create your own set of SHACL rules ? You don&rsquo;t have a tool to do that and you don&rsquo;t want to write Turtle file by hand ? One technique I use is to edit them in an Excel spreadsheet that is converted in RDF using <a href="http://labs.sparna.fr/skos-play/convert">SKOS Play Excel 2 RDF converter</a>. Here are 1 example of such a file : <a href="http://openarchaeo.huma-num.fr/federation/resources/shapes/OpenArchaeo-Shapes.xlsx">OpenArchaeo shapes</a> in Excel.</p>
<p>You could start from this template and modify it to create your own Shapes Graph.</p>
<p><strong>Now let&rsquo;s SHACL Play!</strong></p>
<p>&nbsp;</p>
<p><em>Post illustration : &laquo;&nbsp;Calculateur&nbsp;&raquo; Bulletin des sciences mathématiques 1922, found from https://www.bnf.fr/fr/mathematiques-informatique-et-sciences-du-numerique, from Gallica at <a href="https://gallica.bnf.fr/ark:/12148/bpt6k9620547z/f123.item">https://gallica.bnf.fr/ark:/12148/bpt6k9620547z/f123.item</a><br />
</em></p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2020/03/11/shacl-play-online-shacl-rdf-validator/">SHACL Play! free online SHACL validator for RDF data</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/2020/03/11/shacl-play-online-shacl-rdf-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
