Skip to content

Instantly share code, notes, and snippets.

View stain's full-sized avatar

Stian Soiland-Reyes stain

View GitHub Profile
@stain
stain / example.xml
Created January 28, 2013 16:54
XSLT for translating OWL ontologies in RDF/XML format (specifically from OWL API/Protege) to a simplistic HTML, with a hyperlink to documentation.html. To use, modify the XML headers of the OWL file as in the example.xml below.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="owl2html.xslt"?>
<rdf:RDF xmlns="http://example.com/ontology/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
@stain
stain / vocabulary-jsonld.json
Last active January 10, 2025 06:54
Example of how a simple OWL ontology / RDFS vocabulary could be defined with JSON-LD, defining the meaning of properties and classes. The second file shows the RDF triples of the vocabulary by using the JSON-LD sandbox. As a visualization - see http://www.essepuntato.it/lode/owlapi/https://gist.github.com/stain/7690362/raw/114f836a64291a3f894c44…
{ "@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"express": "http://example.com/express#",
"defines": {
"@reverse": "rdfs:isDefinedBy"
},
"propertyOf": {
"@id": "rdfs:domain",
#!/usr/bin/env python
__author__ = 'Eric Van Cleve'
__copyright__ = 'Copyright 2019, Proofpoint Inc'
__license__ = 'GPL v.3'
__version__ = '3.0.1'
__email__ = 'evancleve@proofpoint.com'
__status__ = 'Production'
## PROMINENT NOTICE:
# This script was modified 2023-07-13 by Stian Soiland-Reyes, The University of Manchester, UK
@stain
stain / ro-crate-metadata.jsonld
Created November 7, 2024 16:32
Example of nested @graph and its conversions to quads
{
"@context": "https://w3id.org/ro/crate/1.1/context",
"@graph": [
{
"@id": "ro-crate-metadata.json",
"@type": "CreativeWork",
"conformsTo": {
"@id": "https://w3id.org/ro/crate/1.1"
},
"about": {
@stain
stain / .notmuch-config
Last active November 13, 2023 08:17
NotMuch hooks for selectively sorting to inbox, moving archived messages to other folder. offlineimap syncs to /home/USER/mail/company and /home/USER/mail/org1
[database]
path=/home/USER/mail
[user]
name=MyName MySurname
primary_email=me@example.com
other_email=me@example.org
#!/usr/bin/env python
__author__ = 'Eric Van Cleve, Stian Soiland-Reyes'
__copyright__ = 'Copyright 2019, Proofpoint Inc, 2023 The Universit of Manchester'
__license__ = 'GPL v.3'
__version__ = '3.1-rewriter'
__email__ = 'evancleve@proofpoint.com'
__status__ = 'Production'
## PROMINENT NOTICE:
# This script was modified 2023-07-13 by Stian Soiland-Reyes, The University of Manchester, UK
@stain
stain / 6604.provn
Last active June 29, 2023 08:44
Converting INTEGRAL DAG to PROVN
document
default <http://example.com/run/123123/>
used(analysis-LCEnergyBins-7b7a5d9c-f493-59cd-955b-fff6c22eb961, None, -)
used(analysis-ScWData-1db23960-cc7f-5870-8bc3-291178cee01c, c851f1e7-2551-5da5-b9ca-7e23775c2f1c, -)
used(analysis-IBIS_ICRoot-06661d84-b2c2-57c0-9adb-c0447d7031f0, analysis-ICRoot-7b7a5d9c-f493-59cd-955b-fff6c22eb961, -)
used(analysis-ICRoot-7b7a5d9c-f493-59cd-955b-fff6c22eb961, None, -)
used(analysis-GBcat-8f868fbb-fd81-5b5e-95f5-0d4ed55334d4, list-305c4589-a8ad-57a6-a946-8694e81bc22f, -)
used(analysis-GRcat-43383b87-35f4-547e-86a5-d6c92229876c, analysis-SourceCatalog-7b7a5d9c-f493-59cd-955b-fff6c22eb961, -)
used(analysis-CatForSpectra-43383b87-35f4-547e-86a5-d6c92229876c, analysis-SourceCatalog-7b7a5d9c-f493-59cd-955b-fff6c22eb961, -)
{
"@context": "https://w3id.org/ro/crate/1.1/context",
"@graph": [
{
"@type": "CreativeWork",
"@id": "ro-crate-metadata.json",
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.1"},
"about": {"@id": "https://disprot.org/#2021-08"}
},
{

>>>>> gd2md-html alert: ERRORs: 1; WARNINGs: 1; ALERTS: 13.

  • See top comment block for details on ERRORs and WARNINGs.
  • In the converted Markdown or HTML, search for inline alerts that start with >>>>> gd2md-html alert: for specific instances that need correction.
@stain
stain / schema-skos-transitive.jsonld
Last active November 23, 2021 11:18
SKOS transitive version of schema.org 8.0 class hierarchy - SPARQL executed on all-frames.nt from https://schema.org/docs/developers.html
{
"@graph" : [ {
"@id" : "http://schema.org/",
"@type" : "skos:ConceptScheme",
"hasTopConcept" : "schema:Thing"
}, {
"@id" : "schema:3DModel",
"@type" : "skos:Concept",
"broader" : [ "schema:Thing", "schema:CreativeWork", "schema:MediaObject" ],
"broaderTransitive" : "schema:MediaObject",