Commit 8880810c authored by josd's avatar josd

modalities producing Turtle or N3

parent 11b45c23
from sympy import *
x = Symbol('x')
print(integrate(exp(-x**2), (x, -oo, oo)))
#!/bin/bash
python3 integrate-bell.py > integrate-bell.txt
EASTER 2019-04-21
EASTER 2020-04-12
EASTER 2021-04-04
EASTER 2022-04-17
EASTER 2023-04-09
#!/bin/bash
python3 easter.py > easter.txt
from sympy import *
x = Symbol('x')
y = integrate(exp(-x**2), (x, -oo, oo))
print('PREFIX : <http://josd.github.io/eye/modality#>')
print('')
print('"exp(-x**2), (x, -oo, oo)" :integrate "%s".' % (y))
PREFIX : <http://josd.github.io/eye/modality#>
"exp(-x**2), (x, -oo, oo)" :integrate "sqrt(pi)".
#!/bin/bash
python3 integrate-bell.py > integrate-bell.ttl
......@@ -13,8 +13,11 @@ def calc_easter(year):
day = f % 31 + 1
return date(year, month, day)
print("EASTER", calc_easter(2019))
print("EASTER", calc_easter(2020))
print("EASTER", calc_easter(2021 ))
print("EASTER", calc_easter(2022))
print("EASTER", calc_easter(2023))
print('PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>')
print('PREFIX : <http://josd.github.io/eye/modality#>')
print('')
print('2019 :easter "%s"^^xsd:date.' % (calc_easter(2019)))
print('2020 :easter "%s"^^xsd:date.' % (calc_easter(2020)))
print('2021 :easter "%s"^^xsd:date.' % (calc_easter(2021)))
print('2022 :easter "%s"^^xsd:date.' % (calc_easter(2022)))
print('2023 :easter "%s"^^xsd:date.' % (calc_easter(2023)))
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX : <http://josd.github.io/eye/modality#>
2019 :easter "2019-04-21"^^xsd:date.
2020 :easter "2020-04-12"^^xsd:date.
2021 :easter "2021-04-04"^^xsd:date.
2022 :easter "2022-04-17"^^xsd:date.
2023 :easter "2023-04-09"^^xsd:date.
#!/bin/bash
python3 easter.py > easter.ttl
......@@ -4,4 +4,8 @@ def fib(n, c={0:1, 1:1}):
c[n] = fib(x-1) * fib(n-x-1) + fib(x) * fib(n-x)
return c[n]
print(fib(91))
y = fib(91)
print('PREFIX : <http://josd.github.io/eye/modality#>')
print('')
print('91 :fib "%d".' % (y))
PREFIX : <http://josd.github.io/eye/modality#>
91 :fib "7540113804746346429".
#!/bin/bash
python3 fib.py > fib.txt
python3 fib.py > fib.ttl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment