- Most of the time,
\tt
/\texttt
instead ofverb!!
- Create macro for common tools
\Javascript
- Section, Table and Figure with a majuscule, (stop forgetting about this)
- an rdf because "an airdieff"
- "semantic" → adjectif, "semantics" → nom (même au singulier)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test parser from the W3C test suite manifest | |
describe("Tests from manifest", () => { | |
// const manifestUrl = "https://www.w3.org/2013/rdf-mt-tests/manifest.ttl"; | |
const manifestContent = fs.readFileSync(path.join(__dirname, "w3c-test-manifest.ttl"), "utf8"); | |
const manifestQuads = new n3.Parser().parse(manifestContent); | |
let tests = new TermMap<RDF.Quad_Subject, ManifestedTest>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix sh: <http://www.w3.org/ns/shacl#> | |
prefix xsd: <http://www.w3.org/2001/XMLSchema#> | |
prefix owl: <http://www.w3.org/2002/07/owl#> | |
prefix ex: <http://example.com/ns#> | |
prefix s: <http://schema.org/> | |
ex:OneStep a sh:NodeShape ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as RDF from '@rdfjs/types'; | |
import TermMap from '@rdfjs/term-map'; | |
import TermSet from '@rdfjs/term-set'; | |
type EpsTransition = { | |
symbol: RDF.Term | null; | |
next: RDF.Term | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Incremental state for lang-turtle in my repository prec-demo | |
// It gives me serious headaches so I'm gisting it | |
import { Language, syntaxTree } from "@codemirror/language"; | |
import { EditorState, StateField, Transaction } from "@codemirror/state"; | |
import { SyntaxNode } from "@lezer/common"; | |
import * as RDF from "@rdfjs/types"; | |
import { DataFactory, Store } from 'n3'; | |
function buildForest() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return all occurences of the given terms in a DStar Dataset | |
* @see https://github.com/BruJu/PREC | |
*/ | |
function findAllOccurrencesOfTerms(graph: DStar, terms: RDF.Term[]): RDF.Quad[] { | |
return terms.flatMap(term => [ | |
...graph.getQuads(term, null, null, $defaultGraph), | |
...graph.getQuads(null, term, null, $defaultGraph), | |
...graph.getQuads(null, null, term, $defaultGraph), | |
...graph.getRDFStarQuads().filter(q => QuadStar.containsTerm(q, term)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The feature that Rust needs | |
trait Animal { const LEGS: u32; } | |
fn walk_on_your_two_legs<A>(_animal: &A) | |
where A: Animal | |
// , A::LEGS == 2 :( | |
{ | |
println!("I'm walking on my two legs") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* | |
* This script enables to store multi nested quads in an N3.Store | |
* Usage: | |
* Add quads with addQuadsWithoutMultiNesting(store, quads) | |
* The store will contain the quads, but 2sd level nested quads will be replaced with a blank node | |
* When you have a quad for which you want the true version, use remakeMultiNesting(store, quads) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX prec: <http://bruy.at/prec#> | |
PREFIX pvar: <http://bruy.at/prec-trans#> | |
PREFIX pgo: <http://ii.uwb.edu.pl/pgo#> | |
PREFIX ex: <http://example.org/> | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
# A PREC Context to produce RDF graphs similar to the one produced by graphConv | |
# PREC: https://github.com/BruJu/PREC | |
# graphConv: https://github.com/domel/graphConv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === transformProperties | |
// TODO: | |
// if (asSet) { | |
// for (const bind of newB) { | |
// noList(store, bind.x); | |
// } | |
// } |