sparna-git / shacl-play

SHACL validation UI, SHACL documentation generator, SHACL generator from RDF.
http://shacl-play.sparna.fr
GNU Lesser General Public License v3.0
24 stars 15 forks source link

Add JSON-LD snippet in output HTML for search engine indexing #77

Closed andrea-perego closed 2 weeks ago

andrea-perego commented 1 year ago

An example of the JSON-LD snippet, using (some) metadata from https://europarl.github.io/eli-ep/ :

<html lang="en">
<head>
  ...
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "url": "https://data.europarl.europa.eu/def/eli-ep#",
  "name": "ELI-EP Application Profile",
  "datePublished": "2022-08-19",
  "version": "0.4.4",
  "license": "https://www.europarl.europa.eu/legal-notice/",
  "author": [
    {
      "@type": "Organization",
      "name": "European Parliament",
      "url": "https://www.europarl.europa.eu/"
    }
  ],
  "publisher": [
    {
      "@type": "Organization",
      "name": "European Parliament",
      "url": "https://www.europarl.europa.eu/"
    }
  ],
  ...
}
</script>
  ...
</head>
  ...
</html>
tfrancart commented 1 month ago

If we don't have the Ontology, do not generate the JSON-LD snippet.

tfrancart commented 3 weeks ago
  1. Indenter le JSON
  2. Ne pas mettre de name sur les Organization si on ne l'a pas. Utiliser le même code de récupération des libellés que pour l'entête d'affichage. On prend le Link.getLabel() sauf s'il est égal à Link.getUri()