semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

Errors storing triples with "(),." inside a name #14

Open redskate opened 13 years ago

redskate commented 13 years ago

Dear ARC2 community,

I am trying to INSERT DATA INTO a graph with ARC2 And it runs quite well for most values, as long as the entities which I insert do not contain the following chars:

( ) parenthesis

A sparql query used in my application is thus: prefix owl: http://www.w3.org/2002/07/owl# prefix xsd: http://www.w3.org/2001/XMLSchema# prefix rdfs: http://www.w3.org/2000/01/rdf-schema# prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# prefix Ontology1312540720780: http://www.semanticweb.org/ontologies/2011/7/Ontology1312540720780.owl# INSERT INTO http://localhost { Ontology1312540720780:'charge_carriers(kind-of-carriers)' rdfs:seeAlso 'stripe' . }

results in an error:

Construct Template not found in ARC2_SPARQLPlusParser

-> This should not happen, since the requirements for an xml name (see http://www.w3.org/TR/REC-xml/#NT-Nmtoken) foresee the presence of parenthesis inside a name

-> Could anybody tell me how to fix that? Thanks Cheers Redskate

BorderCloud commented 13 years ago

Hello

I fork ARC2 And I resolve a problem like you but the syntax is not exactly the same. https://github.com/BorderCloud/arc2/blob/master/lib/arc2/parsers/ARC2_SPARQLPlusParser.php

What is your server ? jena, 4store ? If I can test, maybe, I can resolve your problem.

Bye

redskate commented 13 years ago

Hi BorderCloud

thank You very much for answering. I am using no further Framework, just ARC2 under Apache2. I will try soon your code in my ARC installation.

Regards

eppfel commented 12 years ago

I think we have the same issue. At the following URI's the insert command aborts and cuts off the rest of the query. Therefore it is impossible to store larger triple sets. We did not come up with a solution or at least with a work around yet. Help would be nice. <http://dbpedia.org/class/yago/PeopleFromDeal,Kent> <http://dbpedia.org/class/yago/Oasis(band)Songs>

The code is available at http://github.com/dharma-guardian/bandclash and the file is crawler.php line 148. We even tried converting into triples, before INSERT instead of a index result, but no effect:

$triples = ARC2::getTriplesFromIndex($index['result']);
$result = $this->_getDefaultLocalStore()->insert($triples, "http://bandclash.net/ontology");