Skip to content

Instantly share code, notes, and snippets.

So first, the overall structure, project definition, and goals of the two separate projects (augment, respond, correct as appropriate). We'll go into exactly how these are implemented/designed next, but first I wanted to make sure the overall division of content is sane and it would be obvious where all the existing content goes to.

pylonsproject.org

@gcarothers
gcarothers / inverse.markdown
Created August 17, 2012 16:47
Turtle Inverse Properties
@gcarothers
gcarothers / GraphTerms.ttl
Created August 22, 2012 15:53
Graph Terms in Turtle
@prefix : <http://www.w3.org/2012/08/RDFNG#> .
:Dataset :stateOf :GraphStore .
:GraphStore :contains :SlotName .
:SlotName :contains :RDFSpace .
:RDFGraph :stateOf :RDFSpace .
:Dataset :contains :GraphName .
:GraphName :contains :RDFGraph .
@gcarothers
gcarothers / export-no438.py
Created September 11, 2012 04:39
no438-query
from datetime import date, datetime, timedelta
import csv
from celery_configs.common_settings import *
from bias.models import init_lexdb
mapper(Court, t.court_table, properties=dict(
district = relation(District, backref='courts'),
judges = relation(Judge, backref='court',
order_by=[t.judge_table.c.last_name,
t.judge_table.c.first_name,
t.judge_table.c.initials]),
case_count=column_property(
select([func.count(t.case_table.c.id)],
t.case_table.c.court_id==t.court_table.c.id,

tl; dr There is no fragment parsing method for HTML. HTML fragments SHOULD be placed into XML literals. Inserting them into a HTML document can be easily accomplished using DOM.

The HTML datatype we are adding to RDF is designed to allow people to store HTML fragments and then reuse them later. In examining a specific use case it becomes clear that they don't work as intended.

Use Case

Alice wants to send a description of a book to Bill, that description includes HTML markup. Bill wants to display that description on a web page.

Alice's Turtle file describing her book:

@gcarothers
gcarothers / unicodefun.py
Last active December 15, 2015 05:19
Testing strings from the RDF Turtle Test Cases
import unicodedata
s = "AZaz\u00c0\u00d6\u00d8\u00f6\u00f8\u02ff\u0370\u037d\u0384\u1ffe\u200c\u200d\u2070\u217f\u2c00\u2fcf\u3001\ud7fb\uf900\ufdc7\ufdf0\ufffd\U00010000\U0001f52b"
def display_string(s):
for c in s:
print("""Character: {c!s}
Codepoint: {code:x}
Name: {name}
Combining: {combining}
""".format(
@gcarothers
gcarothers / PrEfIx.md
Created May 16, 2013 02:40
Description of changes to make to Turtle regarding PrEfIx

PrEfIx and BaSe should be removed from Turtle

PREFIX and BASE were added as features at risk to Turtle before CR. Designed to make it easier to copy and paste between Turtle and SPARQL they have proven controversial. As they are a controversial addition to a settled language they should be removed.

Rationale

The FPWD for the Turtle document published by this working group included the following:

Turtle is already a reasonably settled serialization of RDF. Many implementations of Turtle already exist, we are hoping for feedback from those existing implementers and other people deciding that now would be a good time to support Turtle. There are still a few rough edges that need polishing, and better alignment with the SPARQL triple patterns. The working group does not expect to make any large changes to the existing syntax.

{
"@context": {
"@base": "http://lexmachina.com/data/case/",
"pacer": "http://lexmachina.com/vocab/pacer#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"id": "@id",
"title": "pacer:title",
"bare_civil_action_number": "pacer:cv",
"filed_on": {
"@id": "pacer:filed",
{
"@context": {
"bare_civil_action_number": "pacer:cv",
"docket_entries": "pacer:docketEntry",
"documents": "pacer:document",
"filed_on": {
"@id": "pacer:filed",
"@type": "xsd:date"
},
"judges": "pacer:presiding",