Skip to content

Instantly share code, notes, and snippets.

View kasei's full-sized avatar

Gregory Todd Williams kasei

View GitHub Profile
@kasei
kasei / gist:7383097
Last active December 27, 2015 20:18
SELECT * WHERE {
GRAPH ?G {
?p a rdf:Property .
?p <http://schema.org/rangeIncludes> <http://schema.org/URL> .
OPTIONAL {
?p <http://schema.org/rangeIncludes> ?x .
FILTER (?x != <http://schema.org/URL>) .
}
FILTER (!BOUND(?x)) .
}
@kasei
kasei / rdf-type-system.md
Last active December 22, 2015 06:19
Data Flows and Types in Managing RDF and SPARQL data

Data Flows and Types in Managing RDF and SPARQL data

Data types

The types of data we will concern ourselves with:

  • [T]riples
  • [Q]uads
@kasei
kasei / rdf-line-protocol.md
Last active May 31, 2016 18:55
A line-based protocol for querying and updating triple/quad stores

A line-based protocol for querying and updating triple/quad stores

Below are some thoughts on extending the RDF Patch format syntax to a line-based protocol that allows updating and querying RDF triple and quad stores. This allows triple or quad stores to be used directly by systems that require direct access to the data (e.g. with access to real blank node labels unavailable via SPARQL Query/Update). It also allows modular implementation without requiring systems to use the same language as the store (e.g. using the Jena API) or use wrappers/adapters (e.g. using things like SWIG or XS).

:agg-empty-group rdf:type mf:QueryEvaluationTest ;
mf:name "agg empty group" ;
mf:name "Aggregate over empty group resulting in a row with unbound variables" ;
mf:feature sparql:aggregate ;
rdfs:seeAlso <http://answers.semanticweb.com/questions/17410/semantics-of-sparql-aggregates> ;
# dawgt:approval dawgt:Approved ;
# dawgt:approvedBy <http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2> ;
rdfs:comment "Unapproved on 2012-10-30 due to typo in agg-empty-group.srx";
mf:action
[ qt:query <agg-empty-group.rq> ;
@kasei
kasei / gist:3667578
Created September 7, 2012 16:29
RDF::Query rewriting ideas
$query->rewrite_algebra( postfix => sub {
my $visitor = shift;
my $algebra = shift;
if ($algebra->isa('RDF::Query::Algebra::BasicGraphPattern'))
return $visitor->stop; # stop traversal
if ($algebra->isa('RDF::Query::Algebra::Filter')) {
my $expr = $algebra->expr;
if ($expr->isa('RDF::Query::Expression::Function')) {
@kasei
kasei / gist:2990589
Created June 25, 2012 19:09
embedded perl crash from threaded call_pv invocation
2012-06-25 15:08:04.035 pack[46953:f0b] Listening on localhost:8081
Perl 0x100823200
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
[Switching to process 46953 thread 0x2807]
0x00000001003b80ca in XS_Scalar__Util_blessed ()
(gdb) bt
#0 0x00000001003b80ca in XS_Scalar__Util_blessed ()
#1 0x00000001000bea9c in Perl_pp_entersub ()
@kasei
kasei / gist:2829312
Created May 29, 2012 16:17
SPARQL 1.1 STRBEFORE test

Data

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://example.org/> .

:s1 :str "abc" .
:s2 :str "abc"@en .
:s3 :str "abc"^^xsd:string .
@kasei
kasei / gist:2782695
Created May 24, 2012 16:48
Fuseki form-encoded query error
% telnet sparql.org 80
Trying 140.211.11.85...
Connected to sparql.org.
Escape character is '^]'.
POST /sparql HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: sparql.org
User-Agent: SPARQL11ProtocolValidator/0.1 libwww-perl/5.834
Content-Length: 96
@kasei
kasei / protocol_tests.md
Created May 22, 2012 17:33
proposed SPARQL 1.1 Protocol tests

Proposed SPARQL 1.1 Protocol Tests

This repository contains code which attempts to validate implementations of the SPARQL 1.1 Protocol. It is a work in progress, and subject to change as the Protocol spec continues towards becoming a W3C recommendation, and as we (the SPARQL Working Group) continue to evaluate existing existing implementations.

@kasei
kasei / gist:2480335
Created April 24, 2012 15:01
SPARQL 1.1 test suite xsd canonical lexical form changes
Index: aggregates/agg-err-02.srx
===================================================================
RCS file: /w3ccvs/WWW/2009/sparql/docs/tests/data-sparql11/aggregates/agg-err-02.srx,v
retrieving revision 1.4
diff -r1.4 agg-err-02.srx
13c13
< <literal datatype="http://www.w3.org/2001/XMLSchema#double">2.5e0</literal>
---
> <literal datatype="http://www.w3.org/2001/XMLSchema#double">2.5E0</literal>
29c29