I hereby claim:
- I am pchampin on github.
- I am pchampin (https://keybase.io/pchampin) on keybase.
- I have a public key whose fingerprint is BCB1 45FD 5531 F653 C422 89F0 9D1E DAEE EF98 D438
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
""" | |
This simple service is aimed at web application developers. It allows them to | |
specify in the URL the HTTP response they want to get, in order to test the | |
behaviour of client codes. | |
The PATH_INFO is the desired status code, optionnally followed by a custom | |
message, e.g.: | |
/200 |
/* global Promise */ | |
/** | |
* An IterablePromise is used to combine the ease of use of loops, | |
* with the power of Promises. | |
* | |
* Assume you want to apply an asynchronous function process(), | |
* returning a Promise, to each item of an array ``a``, | |
* but wait for each element to be processed before processing the next one. | |
* You would do it like this: |
from rdflib import BNode, URIRef | |
from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore, _node_to_sparql, _node_from_result, SPARQL_NS | |
from uuid import uuid4 | |
def _virtuoso_compatible_generator(): | |
return unicode(uuid4().int % 2**61) | |
# monkey patch BNode to make it virtuoso compatible | |
BNode.__new__.func_defaults = (None, _virtuoso_compatible_generator, 'b') |
from collections import namedtuple | |
from timeit import default_timer | |
from itertools import repeat | |
class Classic(object): | |
def __init__(self, a, b, c): | |
self.a = a | |
self.b = b | |
self.c = c |
//! This is an experiment on how to get rid of lifetime parameters in | |
//! Sopghia's Graph and Dataset traits. It demonstrates the general idea | |
//! on a simplified version of Triple and Graph. | |
//! | |
//! Graph iterators no longer return Graph::Triple's, | |
//! they return a safe abstraction around it: GuardedTRiple<'a, Graph::Triple>. | |
//! | |
//! Graph::Triple itself can be one of several options: | |
//! * T (where T implements Triple) | |
//! * *const T (where T implements Triple) |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. | |
@prefix math: <http://www.w3.org/2000/10/swap/math#>. | |
@prefix : <#>. | |
{ (?lst 1) :memberAt ?elt } <= { ?lst rdf:first ?elt. }. | |
{ (?lst ?i) :memberAt ?elt } <= { ?lst rdf:first ?elt. ?i math:equalTo 1. }. | |
{ (?lst ?i) :memberAt ?elt } <= { ?lst rdf:rest ?rest. (?rest ?j) :memberAt ?elt. (?j 1) math:sum ?i. }. | |
{ ((41) 1) :memberAt 41 } => { :TEST :PASS 1 }. | |
{ ((41) 1.0) :memberAt 41 } => { :TEST :PASS 2 }. |
#!/usr/bin/env python3 | |
""" | |
This script checks different triple stores implementing RDF*, | |
to see how opaque/transparent are the terms used in embedded triples. | |
""" | |
from sys import argv, stderr | |
import base64 | |
try: | |
import requests | |
except: |
#!/usr/bin/env python | |
# | |
# Command-line JSON-LD processor based on PyLD | |
# | |
# Copyright © 2021-2022 Pierre-Antoine Champin <[email protected]> | |
import argparse | |
import json | |
import sys | |
from urllib.parse import urljoin, urlsplit |
@prefix s: <http://schema.org/>. | |
# simple (unqualified) statement | |
:dr_strangelove a s:Movie ; | |
s:actor :peter_sellers. | |
# RDF-star with "ocurrence" nodes |