Issue 12 in sadi: sadi.py fails to parse valid Turtle

7 views
Skip to first unread message

sa...@googlecode.com

unread,
Dec 21, 2011, 12:02:24 PM12/21/11
to bu...@sadiframework.org
Status: New
Owner: elmccar...@gmail.com
Labels: Type-Defect Product-JavaAPI

New issue 12 by tim...@gmail.com: sadi.py fails to parse valid Turtle
http://code.google.com/p/sadi/issues/detail?id=12

A turtle file [1] that rapper is happy with fails to load when sent to
sadi.py. After quite a bit of attempting to satisfy sadi.py (and rdflib),
I've retreated to dumbing down the input to RDF/XML.

== rapper happy ==

rapper -g -c
add-metadata-materials/sample-inputs/congresspeople-tagged-government.ttl
rapper: Guessed parser name 'turtle'
rapper: Parsing returned 45 triples

== rdflib sad ==

curl -H "Content-Type: text/turtle" -d
@add-metadata-materials/sample-inputs/congresspeople-tagged-government.ttl
http://localhost:9090/add-metadata

rdflib.plugins.parsers.notation3.BadSyntax: at line 1 of <>:
Bad syntax (EOF found when expected verb in property list) at ^ in:
"...atafaqs#> .<http://dsi.lod-cloud.net/dataset/congresspeople>^
#<http://thedatahub.org/dataset/congresspeople> a datafa..."

[1]
https://github.com/timrdf/DataFAQs/blob/master/services/sadi/ckan/add-metadata-materials/sample-inputs/congresspeople-tagged-government.ttl

[2]
https://github.com/timrdf/DataFAQs/blob/master/services/sadi/ckan/add-metadata.rpy

test of turtle file:
---------------------
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix ov: <http://open.vocab.org/terms/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix moat: <http://moat-project.org/ns#> .
@prefix datafaqs: <http://purl.org/twc/vocab/datafaqs#> .

<http://dsi.lod-cloud.net/dataset/congresspeople>
#<http://thedatahub.org/dataset/congresspeople>
a datafaqs:CKANDataset ;
datafaqs:namespace
<http://logd.tw.rpi.edu/source/contactingthecongress/dataset/directory-for-the-112th-congress>;
foaf:isPrimaryTopicOf <http://dsi.lod-cloud.net/dataset/congresspeople>;
dcterms:identifier "f4c2a8bb-6580-4919-98aa-617feb766b6c";

ov:shortName "congresspeople";
a ov:DigitalAsset;

a datafaqs:TaggedCKANDataset;
moat:taggedWithTag <http://lod-cloud.net/tag/government>;
a sioc:Item;

void:vocabulary
<http://www.w3.org/2002/07/owl#>,
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
<http://www.w3.org/2000/01/rdf-schema#>,
<http://purl.org/dc/terms/>,
<http://xmlns.com/foaf/0.1/>,
<http://www.w3.org/2000/10/swap/pim/contact#>,
<http://dbpedia.org/property/>,
<http://dbpedia.org/ontology/>,
<http://rdfs.org/ns/void#>,
<http://open.vocab.org/terms/>,
<http://purl.org/vocab/vann/>,
<http://usefulinc.com/ns/doap#>,
<http://purl.org/NET/scovo#>,
<http://purl.org/twc/vocab/conversion/>,
<http://inference-web.org/2.0/pml-provenance.owl#>,
<http://inference-web.org/2.0/pml-justification.owl#>,

<http://logd.tw.rpi.edu/source/contactingthecongress/dataset/directory-for-the-112th-congress/vocab/>,

<http://logd.tw.rpi.edu/source/contactingthecongress/dataset/directory-for-the-112th-congress/vocab/enhancement/1/>;
a void:Dataset;

# links:dbpedia 67
void:subset [
a void:Linkset;
void:target <http://dsi.lod-cloud.net/dataset/congresspeople>,
<http://thedatahub.org/dataset/dbpedia> ;
# http://dbpedia.org/resource
void:triples 67;
];

# links:geonames-semantic-web 50
void:subset [
a void:Linkset;
void:target <http://dsi.lod-cloud.net/dataset/congresspeople>,
<http://thedatahub.org/dataset/geonames-semantic-web> ;
# http://sws.geonames.org
void:triples 50;
];

# links:govtrack 56
void:subset [
a void:Linkset;
void:target <http://dsi.lod-cloud.net/dataset/congresspeople>,
<http://thedatahub.org/dataset/govtrack> ;
# http://www.rdfabout.com/rdf/usgov
void:triples 56;
];

dcterms:isPartOf <http://ckan.net/group/datafaqs>;
.

<http://ckan.net/group/datafaqs> a datafaqs:CKANGroup .

sa...@googlecode.com

unread,
Dec 21, 2011, 12:12:33 PM12/21/11
to bu...@sadiframework.org
Updates:
Owner: mccus...@gmail.com
Labels: -Product-JavaAPI Product-PythonAPI Priority-Medium

Comment #1 on issue 12 by elmccar...@gmail.com: sadi.py fails to parse
valid Turtle
http://code.google.com/p/sadi/issues/detail?id=12

Setting the product tag to Product-PythonAPI instead of Product-JavaAPI as
this is a Python issue and not a Java one.

sa...@googlecode.com

unread,
Dec 21, 2011, 12:55:03 PM12/21/11
to bu...@sadiframework.org

Comment #2 on issue 12 by tim...@gmail.com: sadi.py fails to parse valid
Turtle
http://code.google.com/p/sadi/issues/detail?id=12

We've narrowed it down to the "indented comments" such as:

# links:dbpedia 67
void:subset [
a void:Linkset;
void:target <http://dsi.lod-cloud.net/dataset/congresspeople>,
<http://thedatahub.org/dataset/dbpedia> ;
# http://dbpedia.org/resource
void:triples 67;
];

(it could also be a newline problem - the rest of the file is a comment...)

sa...@googlecode.com

unread,
Dec 26, 2013, 2:31:53 PM12/26/13
to bu...@sadiframework.org
Updates:
Status: Invalid

Comment #3 on issue 12 by mccus...@gmail.com: sadi.py fails to parse valid
Turtle
http://code.google.com/p/sadi/issues/detail?id=12

According to http://stackoverflow.com/a/7241617/438254 curl with -d will
have a tendency to strip newlines. I've added positive and negative tests
to tests.py for this, after having narrowed it down.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages