Skip to content

Instantly share code, notes, and snippets.

Avatar

Stian Soiland-Reyes stain

View GitHub Profile
@stain
stain / ProfileChecker.java
Created Feb 21, 2012
OWL2 RL checker - needs OWL api
View ProfileChecker.java
package no.s11.owlapi;
import java.io.File;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.profiles.OWL2RLProfile;
import org.semanticweb.owlapi.profiles.OWLProfileReport;
View oa-core.ttl
@prefix : <http://www.w3.org/ns/openannotation/core/#> .
@prefix oa: <http://www.w3.org/ns/openannotation/core/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.w3.org/ns/openannotation/core/> .
<http://www.w3.org/ns/openannotation/core/> rdf:type owl:Ontology ;
@stain
stain / workflowrun.prov.ttl
Created Sep 14, 2012
taverna-prov export
View workflowrun.prov.ttl
# @base <file:/tmp/test3494635138365893811/workflowrun.prov.ttl> .
@prefix cnt: <http://www.w3.org/2011/content#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix scufl2: <http://ns.taverna.org.uk/2010/scufl2#> .
@prefix tavernaprov: <http://ns.taverna.org.uk/2012/tavernaprov/> .
@prefix wfdesc: <http://purl.org/wf4ever/wfdesc#> .
@stain
stain / TestFOAFPROV.java
Created Nov 20, 2012
OWLAPI loading and saving OWL individiuals using FOAF and PROV
View TestFOAFPROV.java
package com.example.owlapitest;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Set;
@stain
stain / test.owl.ttl
Created Dec 5, 2012
Protege infers the rdfs:subClassOf
View test.owl.ttl
:Man rdf:type owl:Class .
:Person rdf:type owl:Class .
[ rdf:type owl:Axiom ;
rdfs:comment "How beautiful"@en ;
owl:annotatedSource :Man ;
owl:annotatedTarget :Person ;
owl:annotatedProperty rdfs:subClassOf
] .
@stain
stain / mediatypes.ttl
Last active Jun 18, 2018
How to define Internet Media Type in RDF - is there a namespace? Yes - but not an official one. See http://answers.semanticweb.com/questions/639/is-there-a-namespace-to-describe-mimetypes-and-encodings and http://mediatypes.appspot.com/
View mediatypes.ttl
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dcam: <http://purl.org/dc/dcam/> .
<http://example.com/page.html> dcterms:format <http://purl.org/NET/mediatypes/text/html> .
<http://purl.org/NET/mediatypes/text/html> a dcterms:FileFormat ;
dcam:memberOf dcterms:IMT ;
rdf:value "text/html" ;
@stain
stain / example.xml
Created Jan 28, 2013
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.
View example.xml
<?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 / test.ttl
Created Feb 8, 2013
difficult to use owl:unionOf and stay in OWL2 RL or DL.
View test.ttl
stain@ralph-ubuntu:~/Desktop$ profilechecker test.owl --all
OWL2DLProfile: OK
OWL2ELProfile: 1 violations
OWL2Profile: OK
OWL2QLProfile: 1 violations
OWL2RLProfile: 1 violations
stain@ralph-ubuntu:~/Desktop$ profilechecker test.owl OWL2RLProfile
Use of non-superclass expression in position that requires a superclass expression: ObjectUnionOf(<http://www.semanticweb.org/stain/ontologies/2013/1/untitled-ontology-2#A> <http://www.semanticweb.org/stain/ontologies/2013/1/untitled-ontology-2#B>) [ObjectPropertyRange(<http://www.semanticweb.org/stain/ontologies/2013/1/untitled-ontology-2#a_or_b> ObjectUnionOf(<http://www.semanticweb.org/stain/ontologies/2013/1/untitled-ontology-2#A> <http://www.semanticweb.org/stain/ontologies/2013/1/untitled-ontology-2#B>)) in OntologyID(OntologyIRI(<http://www.semanticweb.org/stain/ontologies/2013/1/untitled-ontology-2>))]
View gist:5047015
{
"@context": {
"oa": "http://www.w3.org/ns/oa#",
"cnt": "http://www.w3.org/2011/content#",
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"dctypes": "http://purl.org/dc/dcmitype/",
"foaf": "http://xmlns.com/foaf/0.1/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
View gist:5090021
stain@ralph-ubuntu:~$ cwm --rdf=T http://www.hkcr.net/ccd/ccd-a28b82c7-fab4-471d-96bf-000bc83acbdc.xsd --n3=d/r
#Processed by Id: cwm.py,v 1.197 2007/12/13 15:38:39 syosi Exp
# using base http://www.hkcr.net/ccd/ccd-a28b82c7-fab4-471d-96bf-000bc83acbdc.xsd
# Notation3 generation by
# notation3.py,v 1.200 2007/12/11 21:18:08 syosi Exp
# Base was: http://www.hkcr.net/ccd/ccd-a28b82c7-fab4-471d-96bf-000bc83acbdc.xsd
@prefix data-view: <http://www.w3.org/2003/g/data-view#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
You can’t perform that action at this time.