gjhiggins/rdflib — Issue #163: Notation3 parser dot issue
Author: gjhiggins
Created: 2011-10-19 01:33:37+00:00
State: open

Originally filed by fertap...@gmail.com on 2011-03-24T17:17:56

Hi,
I'm using FuXi as inference engine, and it receives the rules expressed in N3 format. Everything goes ok until I need to put a Freebase predicate such as http://rdf.freebase.com/ns/object.type.name.
The N3 parser doesn't distinguish between the "AND operator" dot and the dots of the predicate's URI.

This is an example of a dot used as AND operator:
{?P @has rdfs:range ?C. ?S ?P ?O} => {?O a ?C}.

and this is my N3 rule:
{?S fb:object.type.name ?O} => {?S a fb:namedPerson}.

and I get the error:
File "/Library/Python/2.6/site-packages/rdflib/plugins/parsers/notation3.py", line 1198, in path
"EOF found in middle of path syntax")
rdflib.plugins.parsers.notation3.BadSyntax: at line 44 of <>:
Bad syntax (EOF found in middle of path syntax) at ^ in:
"@prefix log: .
@prefix str: .
@prefix owl: .
@prefix xsd: .
@prefix rdfs: .
@prefix rdf: .
@prefix e: .
@prefix fb: .
@prefix cc: .
@prefix : .

### Resource Description Framework RDF(S)

rdf:Alt rdfs:subClassOf rdfs:Container.
rdf:Bag rdfs:subClassOf rdfs:Container.
rdfs:ContainerMembershipProperty rdfs:subClassOf rdf:Property.
rdfs:Datatype rdfs:subClassOf rdfs:Class.
rdf:Seq rdfs:subClassOf rdfs:Container.
rdf:XMLLiteral rdfs:subClassOf rdfs:Literal; a rdfs:Datatype.

rdfs:comment rdfs:domain rdfs:Resource; rdfs:range rdfs:Literal.
rdfs:domain rdfs:domain rdf:Property; rdfs:range rdfs:Class.
rdf:first rdfs:domain rdf:List; rdfs:range rdfs:Resource; a owl:FunctionalProperty.
rdfs:isDefinedBy rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource; rdfs:subPropertyOf rdfs:seeAlso.
rdfs:label rdfs:domain rdfs:Resource; rdfs:range rdfs:Literal.
rdfs:member rdfs:domain rdfs:Container; rdfs:range rdfs:Resource.
rdf:object rdfs:domain rdf:Statement; rdfs:range rdfs:Resource.
rdf:predicate rdfs:domain rdf:Statement; rdfs:range rdf:Property.
rdfs:range rdfs:domain rdf:Property; rdfs:range rdfs:Class.
rdf:rest rdfs:domain rdf:List; rdfs:range rdf:List; a owl:FunctionalProperty.
rdfs:seeAlso rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource.
rdfs:subClassOf rdfs:domain rdfs:Class; rdfs:range rdfs:Class.
rdfs:subPropertyOf rdfs:domain rdf:Property; rdfs:range rdf:Property.
rdf:subject rdfs:domain rdf:Statement; rdfs:range rdfs:Resource.
rdf:type rdfs:domain rdfs:Resource; rdfs:range rdfs:Class.
rdf:value rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource.

rdf:nil a rdf:List.

### inference rules for RDF(S)

{?S fb:object.type.name ?O} => {?S a fb:conNombre}^..."

Thanks in advance