Skip to content

Instantly share code, notes, and snippets.

@justin2004
justin2004 / Hornet.ttl
Last active March 30, 2023 17:57
EDW - T9
@base <http://my.example.org/> .
@prefix gist: <https://ontologies.semanticarts.com/gist/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix : <http://my.example.org/example/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
:QueenElizabeth rdf:type :AircraftCarrier ;
:has-colour :Gray .
:LittleTug1 rdf:type :Tug ;
@justin2004
justin2004 / README.txt
Last active May 23, 2023 18:53
invoking an external command and triplifying its output
## here is a demonstration of running a python script to alter some source data (a csv file)
and then triplifying the result using SPARQL Anything.
justin@parens:~/repos/mine/forks/new/sparql.anything$ cat py.csv
name,age,city
John,25,New York
Sarah,30,San Francisco
David,28,Los Angeles
Emily,32,Miami
@justin2004
justin2004 / emp.csv
Last active February 23, 2023 13:23
SPARQL Anything (https://github.com/SPARQL-Anything/sparql.anything) -- 2 csv files
emp_ID name supervisor_ID
4 bob 5
5 jo 6
6 sally
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:gist="https://ontologies.semanticarts.com/gist/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:sh="http://www.w3.org/ns/shacl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns="https://ontologies.semanticarts.com/o/gistCore#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<owl:Ontology rdf:about="https://ontologies.semanticarts.com/o/gistCore">
@justin2004
justin2004 / a.fss
Created November 2, 2022 12:40
owl negative prop assertion -- roundtrip
Prefix(ex:=<http://example/>)
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#>)
Ontology(
Declaration(Class(ex:Circle))
@justin2004
justin2004 / a.txt
Created October 25, 2022 16:03
RDF surfaces -- n3 to trig?
justin@parens:/tmp$ cat la.n3
@prefix : <http://example.org/ns#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
(_:X) log:onNegativeSurface {
_:X a :Problem .
} .
justin@parens:/tmp$
justin@parens:/tmp$ ~/Downloads/apache-jena-4.5.0/bin/riot --formatted=trig la.n3
12:02:49 ERROR riot :: [line: 4, col: 29] Not implemented (formulae, graph literals)
@justin2004
justin2004 / 0_readme.md
Last active September 20, 2022 12:18
RDFox reasoning vs Apache Jena reasoning

Apache Jena's OWL reasoner imports tbox.ttl and abox.ttl then derives jena_output_subset.ttl as expected.

RDFox won't import tbox.ttl and produce derivations. But it looks like OWL 2 RL recognizes:

  • intersection of class expressions (ObjectIntersectionOf)
  • existential quantification to a class expression (ObjectSomeValuesFrom)
  • existential quantification to an individual (ObjectHasValue)

Which are used in tbox.ttl. From the docs it looks like RDFox supports OWL 2 RL.

@justin2004
justin2004 / a.rq
Last active August 9, 2022 20:32
owl:intersectionOf deductions
# https://twitter.com/quoll/status/1556831573370175489?s=20&t=R5BxG0YCqncmHW_AG7cBeg
# "If something is an instance of *every* class described in an owl:intersectionOf then
# it can be inferred to be an instance of the intersection."
#
# this query doesn't handle chaining of this rule (you'd have to just run it, insert the triples, then continue until
# no more results)
#
# also i used a construct so the results can be seen
PREFIX : <http://example.com/>
@justin2004
justin2004 / DISCUSSION.md
Created July 19, 2022 13:17
discussion: Shipwreck Cafe's sign out front

Does anyone know the name of the artist that designed the ship in the bottle used on the cafe's logo?

@justin2004
justin2004 / 0.md
Last active April 6, 2022 13:33
jdb
justin@parens:~/repos/mine/forks/new/sparql.anything$ cat a.txt 
next
qtp90045638-25[1] read /app/a.txt
*** Reading commands from /app/a.txt