Skip to content

Instantly share code, notes, and snippets.

View josd's full-sized avatar

Jos De Roo josd

View GitHub Profile
@josd
josd / four_color.pl
Created August 1, 2019 21:11
Four Color test
:- table four_color/2.
% four color
four_color(Place, Color) :-
neighbours(Place, Neighbours),
member(Color, [red, green, blue, yellow]),
\+ four_color(Place, _),
\+ (member(Neighbour, Neighbours), four_color(Neighbour, Color)).
% map of European Union
@josd
josd / gist:0602211c0a73bbbccb16d5f7f3c6601f
Created November 5, 2019 00:12
proofcheck for witch
$ proofcheck --report http://josd.github.io/eye/reasoning/witch/witch-proof.n3
.. list-table:: Proof
:widths: 2 70 20 20
:header-rows: 1
* - Step
- Formula
- Justification
- Bindings
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix ex: <http://example.org/test#> .
_:a ex:firstName "John"; ex:lastName "Steinbeck" .
{_:a ex:firstName "John"; ex:lastName "Steinbeck"} ex:until "1968-12-20"^^xsd:date .
{_:a ex:firstName "John"} ex:until "1968-12-20"^^xsd:date .
{_:a ex:lastName "Steinbeck"} ex:until "1968-12-20"^^xsd:date .
<<_:a ex:firstName "John">> ex:until "1968-12-20"^^xsd:date .
<<_:a ex:lastName "Steinbeck">> ex:until "1968-12-20"^^xsd:date .
@josd
josd / inf_nan.n3
Created September 11, 2020 20:14
inf and nan tests
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix : <http://example.org/test#>.
{ "INF"^^xsd:double math:greaterThan 42 } => { :TEST :PASS 1 }.
{ 42 math:lessThan "INF"^^xsd:double } => { :TEST :PASS 2 }.
{ "-INF"^^xsd:double math:lessThan 42 } => { :TEST :PASS 3 }.
{ 42 math:greaterThan "-INF"^^xsd:double } => { :TEST :PASS 4 }.
{ "-INF"^^xsd:double math:lessThan "INF"^^xsd:double } => { :TEST :PASS 5 }.
{ "INF"^^xsd:double math:greaterThan "-INF"^^xsd:double } => { :TEST :PASS 6 }.
$ cwm http://josd.github.io/eye/reasoning/bi/math_flowc.n3 --think --data
#Processed by Id
# using base http://josd.github.io/eye/reasoning/bi/math_flowc.n3
@prefix : <http://eulersharp.sourceforge.net/2007/07test#> .
:ANSWER1 :IS 42 .
:ANSWER2 :IS 42 .
:ANSWER5 :IS 42 .
@josd
josd / i20000.pl
Created May 28, 2022 21:36
20000 class members
This file has been truncated, but you can view the full file.
'http://example.org/ns#N0'('http://example.org/ns#i0').
'http://example.org/ns#N0'('http://example.org/ns#i1').
'http://example.org/ns#N0'('http://example.org/ns#i2').
'http://example.org/ns#N0'('http://example.org/ns#i3').
'http://example.org/ns#N0'('http://example.org/ns#i4').
'http://example.org/ns#N0'('http://example.org/ns#i5').
'http://example.org/ns#N0'('http://example.org/ns#i6').
'http://example.org/ns#N0'('http://example.org/ns#i7').
'http://example.org/ns#N0'('http://example.org/ns#i8').
'http://example.org/ns#N0'('http://example.org/ns#i9').
# eye --quiet --nope --quantify http://eyereasoner.github.io/.well-known/genid/ https://raw.githubusercont
ent.com/doerthe/SPARQL-to-N3/main/SPIN-to-N3/examples/select-aggr-5.ttl https://raw.githubusercontent.com/doerthe/SPARQL-to-N3/main/SPIN-to-N3/auxiliary-files/aux.n3 --quer
y https://raw.githubusercontent.com/doerthe/SPARQL-to-N3/main/SPIN-to-N3/queries/query_general.n3
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix spin: <http://spinrdf.org/spin#>.