Skip to content

Instantly share code, notes, and snippets.

View jeswr's full-sized avatar
🚀
building the things

Jesse Wright jeswr

🚀
building the things
View GitHub Profile
{
"items": [
{
"termType": "NamedNode",
"value": "http://example.org/a"
},
{
"termType": "NamedNode",
"value": "http://example.org/b"
}
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcam: <http://purl.org/dc/dcam/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
rdfs:label rdfs:subPropertyOf owl:AnnotationProperty .
rdfs:comment rdfs:subPropertyOf owl:AnnotationProperty .
@jeswr
jeswr / rdfs.hylar
Last active April 2, 2022 03:57
rdfs
(?uuu ?aaa ?yyy) -> (?aaa rdf:type rdf:Property)
(?aaa rdfs:domain ?xxx) ^ (?uuu ?aaa ?yyy) -> (?uuu rdf:type ?xxx)
(?aaa rdfs:range ?xxx) ^ (?uuu ?aaa ?vvv) -> (?vvv rdf:type ?xxx)
(?uuu ?aaa ?xxx) -> (?uuu rdf:type rdfs:Resource)
(?uuu ?aaa ?vvv) -> (?vvv rdf:type rdfs:Resource)
(?uuu rdfs:subPropertyOf ?vvv) ^ (?vvv rdfs:subPropertyOf ?xxx) -> (?uuu rdfs:subPropertyOf ?xxx)
(?uuu rdf:type rdf:Property) -> (?uuu rdfs:subPropertyOf ?uuu)
(?aaa rdfs:subPropertyOf ?bbb) ^ (?uuu ?aaa ?yyy) -> (?uuu ?bbb ?yyy)
(?uuu rdf:type rdfs:Class) -> (?uuu rdfs:subClassOf rdfs:Resource)
(?uuu rdfs:subClassOf ?xxx) ^ (?vvv rdf:type ?uuu) -> (?vvv rdf:type ?xxx)
@jeswr
jeswr / hylar
Created December 28, 2021 00:12
owl2rl
(?p http://www.w3.org/2000/01/rdf-schema#domain ?c) ^ (?x ?p ?y) -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type ?c)
(?p http://www.w3.org/2000/01/rdf-schema#range ?c) ^ (?x ?p ?y) -> (?y http://www.w3.org/1999/02/22-rdf-syntax-ns#type ?c)
(?p http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#FunctionalProperty) ^ (?x ?p ?y1) ^ (?x ?p ?y2) -> (?y1 http://www.w3.org/2002/07/owl#sameAs ?y2)
(?p http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#InverseFunctionalProperty) ^ (?x1 ?p ?y) ^ (?x2 ?p ?y) -> (?x1 http://www.w3.org/2002/07/owl#sameAs ?x2)
(?p http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#IrreflexiveProperty) ^ (?x ?p ?x) -> false
(?p http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#SymmetricProperty) ^ (?x ?p ?y) -> (?y ?p ?x)
(?p http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#AsymmetricProperty) ^ (?x ?p ?y) ^ (?y ?p ?x) -> false
(?p http://www.w3.or
@jeswr
jeswr / next-infer.hylar
Created December 31, 2021 14:13
next-infer
(?uuu rdfs:subClassOf ?xxx) ^ (?vvv rdf:type ?uuu) -> (?vvv rdf:type ?xxx)
@jeswr
jeswr / gist:e17029d06a5cf25ce2c59eae4196a5a5
Created March 24, 2022 02:54
AsyncIterator performance tests
import { CLOSED, ENDED } from 'asynciterator';
import { ArrayIterator as OldArrayIterator } from 'asynciterator';
import { ArrayIterator, AsyncIterator, range } from './asynciterator'
type Transform = {
type: 'filter';
function: (elem: any) => boolean
} | {
type: 'map';
function: (elem: any) => any
@jeswr
jeswr / test.ts
Created March 24, 2022 02:55
AsyncIterator Performance Testing
import { CLOSED, ENDED } from 'asynciterator';
import { ArrayIterator as OldArrayIterator } from 'asynciterator';
import { ArrayIterator, AsyncIterator, range } from './asynciterator'
type Transform = {
type: 'filter';
function: (elem: any) => boolean
} | {
type: 'map';
function: (elem: any) => any
public async execute({ rules, context }: IActionRdfReasonExecute): Promise<void> {
const nodes: IRuleNode[] = rules.map(rule => ({ rule, next: [] }));
// Creating rule dependencies
for (const n1 of nodes) {
for (const n2 of nodes) {
if (n1.rule.conclusion === false) {
continue;
}
This specification MUST be implmented by POD providers.
The Background Agent Service Specification (BASS) is developed as a way to enable *internet based* agents to *READ*, *MODIFY* and *WRITE* to PODS.
If there is a file `./agents.(ttl|rdf|xml|...)` located in the ROOT of a users POD then the provider MUST attempt to parse the file - if the file contains valid RDF data then it MUST execute the following logic
# Note this step may not be necessary, or, may be generalized to more similar contexts
?1) MUST apply RDF reasoning over the file, BASS ontology, and all imports of the BASS ontology. For security reasons, imports from the agents file SHOULD NOT be included.
2) TODO: Discuss how a file that looks like what is below should be processed
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
foaf:Person owl:sameAs <http://example.org/jesse#Person> .