You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Tim Harsch <ha...@yahoo.com> on 2011/03/08 17:29:47 UTC

TTL parse error

I created a toy ontology and exported it to TTL via Top Braid Composer:
https://gist.github.com/860486#file_schema.ttl


It produced a parse error (below).  I don't know if TBC is producing bad TTL or if Jena is in error when parsing.  It looks like valid TTL to me, but then I don't know the spec that well.

com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line 50, column 8.  Encountered: " " (32), after : "-"
at com.hp.hpl.jena.n3.turtle.ParserTurtle.parse(ParserTurtle.java:44)
at com.hp.hpl.jena.n3.turtle.TurtleReader.readWorker(TurtleReader.java:21)
at com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:101)
at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:68)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:226)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2148)
at com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:395)
at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:335)
at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:319)
at com.cray.km.drivers.OntologySearch.createComprehensiveOntology(OntologySearch.java:52)
at com.cray.km.tests.drivers.TestOntologyExtract.Test1b(TestOntologyExtract.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<...SNIP...>
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


      

Re: TTL parse error

Posted by Andy Seaborne <an...@epimorphics.com>.
Bug fix applied.

Writes the shared list in un-pretty form.

	Andy

On 08/03/11 17:07, Andy Seaborne wrote:
> It's a bug in the Jena Turtle writer.
>
> https://issues.apache.org/jira/browse/JENA-53
>
> It's due to the shared list that's causing the problem. The solution
> will be to not use list syntax.
>
> Andy
>
> On 08/03/11 16:55, Andy Seaborne wrote:
>>
>>
>> On 08/03/11 16:33, Ian Dickinson wrote:
>>> On 08/03/11 16:29, Tim Harsch wrote:
>>>> I created a toy ontology and exported it to TTL via Top Braid Composer:
>>>> https://gist.github.com/860486#file_schema.ttl
>>>>
>>>>
>>>> It produced a parse error (below). I don't know if TBC is producing
>>>> bad TTL or if Jena is in error when parsing. It looks like valid TTL
>>>> to me, but then I don't know the spec that well.
>>>>
>>>> com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line
>>>> 50, column 8. Encountered: " " (32), after : "-"
>>>
>>> Line 50 says:
>>>
>>> _:b1 :- (:Brother :Parent) .
>>>
>>> which doesn't look like valid Turtle to me. I don't think you can have a
>>> predicate name which is just '-'.
>>
>> It's not a predicate, it just looks like one :-)
>>
>> It's the N3 operator for "names" and you can't have it in Turtle.
>>
>> But it might be the Jena writer at fault, which has overtones of N3
>> (history).
>>
>> Andy
>>
>>>
>>> Ian
>>>
>>>

Re: TTL parse error

Posted by Andy Seaborne <an...@epimorphics.com>.
It's a bug in the Jena Turtle writer.

https://issues.apache.org/jira/browse/JENA-53

It's due to the shared list that's causing the problem.  The solution 
will be to not use list syntax.

	Andy

On 08/03/11 16:55, Andy Seaborne wrote:
>
>
> On 08/03/11 16:33, Ian Dickinson wrote:
>> On 08/03/11 16:29, Tim Harsch wrote:
>>> I created a toy ontology and exported it to TTL via Top Braid Composer:
>>> https://gist.github.com/860486#file_schema.ttl
>>>
>>>
>>> It produced a parse error (below). I don't know if TBC is producing
>>> bad TTL or if Jena is in error when parsing. It looks like valid TTL
>>> to me, but then I don't know the spec that well.
>>>
>>> com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line
>>> 50, column 8. Encountered: " " (32), after : "-"
>>
>> Line 50 says:
>>
>> _:b1 :- (:Brother :Parent) .
>>
>> which doesn't look like valid Turtle to me. I don't think you can have a
>> predicate name which is just '-'.
>
> It's not a predicate, it just looks like one :-)
>
> It's the N3 operator for "names" and you can't have it in Turtle.
>
> But it might be the Jena writer at fault, which has overtones of N3
> (history).
>
> Andy
>
>>
>> Ian
>>
>>

Re: TTL parse error

Posted by Andy Seaborne <an...@epimorphics.com>.

On 08/03/11 16:33, Ian Dickinson wrote:
> On 08/03/11 16:29, Tim Harsch wrote:
>> I created a toy ontology and exported it to TTL via Top Braid Composer:
>> https://gist.github.com/860486#file_schema.ttl
>>
>>
>> It produced a parse error (below).  I don't know if TBC is producing bad TTL or if Jena is in error when parsing.  It looks like valid TTL to me, but then I don't know the spec that well.
>>
>> com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line 50, column 8.  Encountered: " " (32), after : "-"
>
> Line 50 says:
>
> _:b1 :- (:Brother :Parent) .
>
> which doesn't look like valid Turtle to me. I don't think you can have a
> predicate name which is just '-'.

It's not a predicate, it just looks like one :-)

It's the N3 operator for "names" and you can't have it in Turtle.

But it might be the Jena writer at fault, which has overtones of N3 
(history).

	Andy

>
> Ian
>
>

Re: TTL parse error

Posted by Ian Dickinson <ia...@epimorphics.com>.
On 08/03/11 16:29, Tim Harsch wrote:
> I created a toy ontology and exported it to TTL via Top Braid Composer:
> https://gist.github.com/860486#file_schema.ttl
> 
> 
> It produced a parse error (below).  I don't know if TBC is producing bad TTL or if Jena is in error when parsing.  It looks like valid TTL to me, but then I don't know the spec that well.
> 
> com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line 50, column 8.  Encountered: " " (32), after : "-"

Line 50 says:

_:b1 :- (:Brother :Parent) .

which doesn't look like valid Turtle to me. I don't think you can have a
predicate name which is just '-'.

Ian


-- 
____________________________________________________________
Ian Dickinson                   Epimorphics Ltd, Bristol, UK
mailto:ian@epimorphics.com        http://www.epimorphics.com
cell: +44-7786-850536              landline: +44-1275-399069
------------------------------------------------------------
Epimorphics Ltd.  is a limited company registered in England
(no. 7016688). Registered address: Court Lodge, 105 High St,
              Portishead, Bristol BS20 6PT, UK