Skip to content

Commit

Permalink
Applying changes from commit 9b4205e66646be2353c984f328ec33f7f45220e5
Browse files Browse the repository at this point in the history
  • Loading branch information
Circle CI Builder committed Sep 11, 2024
1 parent 938e292 commit f48987a
Show file tree
Hide file tree
Showing 32 changed files with 10,289 additions and 12,782 deletions.
36 changes: 18 additions & 18 deletions OOTS/ProofOfBirth/releases/0.0.1/html/examples/ProofOfBirth.jsonld
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"@context": [
"https://semiceu.github.io/uri.semic.eu-generated/Core-Person-Vocabulary/releases/2.1.1/context/core-person-ap.jsonld",
"https://data-models-oots-tdd-8b6791fd33fcb1f29c7d6ad9c6173ba55d28c0a5f9.pages.code.europa.eu/Evidence/ProofOfBirth/releases/0.0.1/context/proofofbirth.jsonld",
{
"cv": "http://data.europa.eu/m8g/",
"dct": "http://purl.org/dc/terms/",
"ex": "http://example.com/",
"foaf": "http://xmlns.com/foaf/0.1/",
"locn": "http://www.w3.org/ns/locn#",
"person": "http://www.w3.org/ns/person#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"skos": "http://www.w3.org/2004/02/skos/core#"
"person": "http://www.w3.org/ns/person#"
}],
"@graph": [
{
"@id": "ex:person",
"@id": "ex:proofofbirth1",
"@type" : "ProofOfBirth",
"dct:subject" : {
"@id": "ex:person1"
}
},
{
"@id": "ex:person1",
"@type": "Person",
"person:birthName" : {
"foaf:givenName" : {
"@language": "fr",
"@value": "René François Ghislain Magritte"
},
"cv:birthDate" : {
"@type": "cv:genericDate",
"@value": "1898-11-21"
},
"person:countryOfBirth" : {
"@id": "ex:location2"
"@value": "René François Ghislain"
},
"foaf:familyName" : {
"@language": "fr",
"@value": "Magritte"
},
"foaf:givenName" : {
"@language": "fr",
"@value": "René François Ghislain"
"cv:birthDate" : {
"@type": "cv:genericDate",
"@value": "1898-11-21"
},
"person:placeOfBirth" : {
"@id": "ex:location1"
},
"person:countryOfBirth" : {
"@id": "ex:location2"
},
"cv:sex" : {
"@id" : "http://publications.europa.eu/resource/authority/human-sex/MALE"
}
Expand Down
14 changes: 7 additions & 7 deletions OOTS/ProofOfBirth/releases/0.0.1/html/examples/ProofOfBirth.ttl
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix cv: <http://data.europa.eu/m8g/> .
@prefix ex: <http://example.com/> .
@prefix person: <http://www.w3.org/ns/person#> .

ex:person person:birthName "René François Ghislain Magritte"@fr ;
cv:birthDate "1898-11-21"^^cv:genericDate ;
person:countryOfBirth ex:location2 ;
ex:proofofbirth1 dcterms:subject ex:person1 ;
a <http://data.europa.eu/p4s/ProofOfBirth> .

ex:person1 foaf:givenName "René François Ghislain"@fr ;
foaf:familyName "Magritte"@fr ;
foaf:givenName "René François Ghislain"@fr ;
cv:birthDate "1898-11-21"^^cv:genericDate ;
person:placeOfBirth ex:location1 ;
person:countryOfBirth ex:location2 ;
cv:sex <http://publications.europa.eu/resource/authority/human-sex/MALE> ;
a person:Person .

Expand Down
34 changes: 20 additions & 14 deletions OOTS/ProofOfBirth/releases/0.0.1/html/examples/ProofOfBirth.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<sdg:ProofOfBirth xmlns:sdg="http://data.europa.eu/p4s" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://data.europa.eu/p4s ProofOfBirth.xsd ">
<sdg:BirthPerson>
<sdg:GivenName xml:lang="fr">René François Ghislain</sdg:GivenName>
<sdg:FamilyName xml:lang="fr">Magritte</sdg:FamilyName>
<sdg:DateOfBirth>1898-11-21</sdg:DateOfBirth>
<sdg:PlaceOfBirth>
<sdg:GeographicName xml:lang="fr">Lessines</sdg:GeographicName>
</sdg:PlaceOfBirth>
<sdg:CountryOfBirth>
<sdg:GeographicName xml:lang="fr">Belgique</sdg:GeographicName>
</sdg:CountryOfBirth>
<sdg:Sex>Male</sdg:Sex>
</sdg:BirthPerson>
</sdg:ProofOfBirth>
<sdg:ProofOfBirth xmlns:cv="http://data.europa.eu/m8g/" xmlns:sdg="http://data.europa.eu/p4s" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://data.europa.eu/p4s ProofOfBirth.xsd ">
<sdg:isAbout>
<cv:Person>
<cv:CountryOfBirth>
<cv:Location>
<cv:GeographicName xml:lang="fr">Belgique</cv:GeographicName>
</cv:Location>
</cv:CountryOfBirth>
<cv:DateOfBirth>1898-11-21</cv:DateOfBirth>
<cv:FamilyName xml:lang="fr">cv:FamilyName</cv:FamilyName>
<cv:GivenName xml:lang="fr">cv:GivenName</cv:GivenName>
<cv:PlaceOfBirth>
<cv:Location>
<cv:GeographicName xml:lang="fr">Lessines</cv:GeographicName>
</cv:Location>
</cv:PlaceOfBirth>
<cv:Sex>MALE</cv:Sex>
</cv:Person>
</sdg:isAbout>
</sdg:ProofOfBirth>
Binary file modified OOTS/ProofOfBirth/releases/0.0.1/html/overview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OOTS/ProofOfDomicile/releases/0.0.1/html/callout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
255 changes: 255 additions & 0 deletions OOTS/ProofOfDomicile/releases/0.0.1/html/example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
function example_structure(exampleid){
structure=`
<div id="` + exampleid + `-tabs" exampleid="` + exampleid + `" class="tabs tabsstyle">
<ul>
<li><a href="#` + exampleid + `-tabs-1">Turtle</a></li>
<li><a href="#` + exampleid + `-tabs-2">JSON-LD</a></li>
<li><a href="#` + exampleid + `-tabs-3">XML</a></li>
</ul>
<div id="` + exampleid + `-tabs-1">
<textarea class="validationquery" id="` + exampleid + `-tab1validationquery" name="query" cols="80" rows="16"></textarea>
<button class="buttonsample copyturtletoclipboard" id="` + exampleid + `-tabs-1-button-1">Copy</button>
<button class="buttonsample openTurtleInConverter" id="` + exampleid + `-tabs-1-button-2">Open in Converter</button>
<button class="buttonsample openTurtleInSHACLPlayground" id="` + exampleid + `-tabs-1-button-3">Validate</button>
</div>
<div id="` + exampleid + `-tabs-2">
<textarea class="validationquery" id="` + exampleid + `-tab2validationquery" name="query" cols="80" rows="16"></textarea>
<button class="buttonsample copyjsonldtoclipboard" id="` + exampleid + `-tabs-2-button-1">Copy</button>
<button class="buttonsample openinplayground" id="` + exampleid + `-tabs-2-button-2">Open in Playground</button>
<button class="buttonsample openJsonldInConverter" id="` + exampleid + `-tabs-2-button-3">Open in Converter</button>
<button class="buttonsample openJsonldInSHACLPlayground" id="` + exampleid + `-tabs-2-button-4">Validate</button>
</div>
<div id="` + exampleid + `-tabs-3">
<textarea class="validationquery" id="` + exampleid + `-tab3validationquery" name="query" cols="80" rows="16"></textarea>
<button class="buttonsample copyXMLtoclipboard" id="` + exampleid + `-tabs-3-button-1">Copy</button>
</div>
</div>`;
return structure;
}


/**
* auxiliary function to get around the issue that indexOf() is not working with jquery.
*/

function myIndexOf(list, val) {
var myindex = -1;
var i = 0;

var elem = list[0];

while ( i < list.length ) {
if ( elem == val ) return i;
i = i+1;
elem = list[i];

}

return -1;

}


/**
* Fills in the direct input area with some samples
* @param {string} file - file containing the sample
*/
function loadFile(editorinstance, file) {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState === 4 && xmlhttp.status !== 200) {
alert('Error when opening the file: ' + file + ' - ' + xmlhttp.status + ' ' + xmlhttp.statusText);
} else if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
editorinstance.setValue(xmlhttp.responseText);
}
};
xmlhttp.open("GET", file, true);
xmlhttp.send();
return xmlhttp.responseText;
}

function loadShape(file, dataGraph, format) {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState === 4 && xmlhttp.status !== 200) {
alert('Error when opening the file: ' + file + ' - ' + xmlhttp.status + ' ' + xmlhttp.statusText);
} else if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
newUrl = "https://shacl-playground.zazuko.com/#page=0&shapesGraph=" + encodeURIComponent(xmlhttp.responseText) + "&shapesGraphFormat=text%2Fturtle&dataGraph=" + encodeURIComponent(dataGraph) + "&dataGraphFormat=" + format ;
//console.log(newUrl);
window.open(newUrl, '_blank');
}
};
xmlhttp.open("GET", file, true);
xmlhttp.send();
return xmlhttp.responseText;
}

function createTurtleEditorFrom(selector) {
return CodeMirror.fromTextArea(selector, {
mode: "turtle",
lineNumbers: true
});
}

function createJSONLDEditorFrom(selector) {
return CodeMirror.fromTextArea(selector, {
mode: "application/ld+json",
lineNumbers: true
});
}

function createXMLEditorFrom(selector) {
return CodeMirror.fromTextArea(selector, {
mode: "application/xml",
lineNumbers: true
});
}


$(document).ready(function () {



var examples = [];
var editors = [];

var examples_id = ".examples";
var examples_class = ".h3";
var folder = "./html/examples/";
var $examples = $(examples_id);

// $examples.children(examples_class).each(function(index){
$examples.each(function(index){
exampleid = this.id;
examples.push(exampleid);
var text = example_structure(exampleid);
$(this).after(text);

var obj = {CM0: createTurtleEditorFrom(document.getElementById(exampleid + "-tab1validationquery")),
CM1: createJSONLDEditorFrom(document.getElementById(exampleid + "-tab2validationquery")),
CM2: createXMLEditorFrom(document.getElementById(exampleid + "-tab3validationquery"))};
editors[index] = obj;
//editors[index].push({CM: createTurtleEditorFrom(document.getElementById(exampleid + "-tab1validationquery")}, CM2: createJSONLDEditorFrom(document.getElementById(exampleid + "-tab2validationquery")});
//editors[index].push({CM: createJSONLDEditorFrom(document.getElementById(exampleid + "-tab2validationquery")});
//editors[index][0] = createTurtleEditorFrom(document.getElementById(exampleid + "-tab1validationquery"));
//editors[index][1] = createJSONLDEditorFrom(document.getElementById(exampleid + "-tab2validationquery"));

$("#" + exampleid + "-tabs").tabs();

$("#" + exampleid + "-tabs a").on('click', function(e) {
$('.CodeMirror').each(function(i, el){
el.CodeMirror.refresh();
});
});

path_to_file = folder + exampleid;
loadFile(editors[index].CM0, path_to_file + ".ttl");
loadFile(editors[index].CM1, path_to_file + ".jsonld");
loadFile(editors[index].CM2, path_to_file + ".xml");

});

$("button.copyturtletoclipboard").on({
"click": function() {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);
texttocopy = editors[index].CM0.getValue()
navigator.clipboard.writeText(texttocopy);
$(this).tooltip({ items: "#" + this.id, content: "Copied !"});
$(this).tooltip("open");
},
"mouseout": function() {
$(this).tooltip("disable");
}
});
$("button.copyjsonldtoclipboard").on({
"click": function() {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);
texttocopy = editors[index].CM1.getValue();
navigator.clipboard.writeText(texttocopy);
$(this).tooltip({ items: "#" + this.id, content: "Copied !"});
$(this).tooltip("open");
},
"mouseout": function() {
$(this).tooltip("disable");
}
});
$("button.copyXMLtoclipboard").on({
"click": function() {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);
texttocopy = editors[index].CM2.getValue();
navigator.clipboard.writeText(texttocopy);
$(this).tooltip({ items: "#" + this.id, content: "Copied !"});
$(this).tooltip("open");
},
"mouseout": function() {
$(this).tooltip("disable");
}
});
$("button.openinplayground").on('click', function(e) {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);

newUrl = "https://json-ld.org/playground/#startTab=tab-expand&json-ld=" + encodeURIComponent(editors[index].CM1.getValue());
window.open(newUrl, '_blank');
return false;
});
$("button.openTurtleInConverter").on('click', function(e) {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);

newUrl = "https://converter.zazuko.com/#value=" + encodeURIComponent(editors[index].CM0.getValue()) + "&format=text%2Fturtle";
window.open(newUrl, '_blank');
return false;
});
$("button.openJsonldInConverter").on('click', function(e) {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);

newUrl = "https://converter.zazuko.com/#value=" + encodeURIComponent(editors[index].CM1.getValue()) + "&format=application%2Fld%2Bjson";
window.open(newUrl, '_blank');
return false;
});
$("button.openTurtleInSHACLPlayground").on('click', function(e) {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);
var shapes = loadShape(shaclfilepath, editors[index].CM0.getValue(), "text%2Fturtle");
return false;
});
$("button.openJsonldInSHACLPlayground").on('click', function(e) {
var exampleid = $(this).parent().parent().attr("exampleid");
var indexValues = $examples.map(function() { return this.id; }) ;
var index = myIndexOf(indexValues, exampleid);
var shapes = loadShape(shaclfilepath, editors[index].CM1.getValue(), "application%2Fld%2Bjson");
return false;
});
$("div.CodeMirror pre").on('click', function(e) {
var et = $(e.target);
if(et.hasClass('cm-url')) {
newUrl = $(this).text();
window.open(encodeURI(newUrl), '_blank');
return false;
}
});
});
Loading

0 comments on commit f48987a

Please sign in to comment.