Skip to content

Commit

Permalink
Update the recipe to create prefix.ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
mpagni12 authored Oct 17, 2024
1 parent 3737cd6 commit 960b058
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions examples/MetaNetX/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
Examples extracted from rdf.metantex.org
`prefix.ttl` was automatically generated as follow:

```js
var examplesh2=
document.querySelectorAll('#mnx_view ol > li');
for (var i=0;i< examplesh2.length;i++) {
let q=examplesh2[i].getElementsByTagName('button')[0].attributes['onclick'].nodeValue;
console.log("prefix ex: <https://sparql.metanetx.org/.well-known/sparql-examples/>\nprefix sh: <http://www.w3.org/ns/shacl#>\nprefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nprefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>\nprefix schema: <https://schema.org/>\nex:"+(i+1)+"\na sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;\n sh:prefixes _:sparql_examples_prefixes, _:metanetx_sparql_examples_prefixes ;\n schema:target <https://rdf.metanetx.org/sparql/> ;\n rdfs:comment '''"+examplesh2[i].firstChild.data.trim()+"''' ; \n sh:select '''"+q.substring(40, q.length -1).trim().replaceAll("\\n","\n")+"'''.");
}
```{bash}
git clone https://github.com/MetaNetX/MNXtools.git MNXtools
cd MNXtools/perl
perl -e 'use lib "."; use Prefix; print Prefix->new()->get_prefix_ontology()' > prefix.ttl
```


0 comments on commit 960b058

Please sign in to comment.