Share

OpenLink Virtuoso (Open-Source Edition)

Tracker: Bugs

5 Importing turtle may fail (snapshot 20090803 and 6.0) - ID: 2872912
Last Update: Comment added ( frodegill )

Given this file (also attached, and note the three commented-out lines) :

==========
@prefix : <http://www.computas.com/mediasone-ontologi#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix mediasone: <http://www.computas.com/mediasone#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:Litteratur rdf:type owl:Class .

:Hoerespill rdf:type owl:Class ;
rdfs:subClassOf :Litteratur .

:Lydbok rdf:type owl:Class ;
rdfs:subClassOf :Litteratur .

#:Lyrikk rdf:type owl:Class ;
# rdfs:subClassOf :Litteratur .

:Sangtekstforfatter rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Class ;
owl:unionOf ( :Hoerespill
:Lydbok
# :Lyrikk
)
] .
==========


In isql-v, I import it as:
"ttlp (file_to_string_output ('testcase.n3'),
'http://www.computas.com/mediasone/','http://msone.computas.no/testcase',
255);"

In both snapshot 20090504 and snapshot 20090803, this work fine. A "select
* FROM <http://msone.computas.no/testcase> WHERE {?s ?p ?o}" returns a fine
linked list, starting with something like
"nodeID://1000011825 http://www.w3.org/2002/07/owl#unionOf nodeID://1000011
826" (more triples follows)

The bug:
Uncomment the three lines in the file. All that changes is that
:Sangtekstforfatter now is a union of three classes, not two. Clear graph,
an reimport. In snapshot 20090504, you will get a fine linked list. In
snapshot 20090803, the linked list is broken, starting with
"nodeID://1000011825 http://www.w3.org/2002/07/owl#unionOf http://www.w3.or
g/1999/02/22-rdf-syntax-ns#nil"


Frode Roxrud Gill ( frodegill ) - 2009-10-05 12:59

5

Open

Fixed

Ivan Mikhailov

RDF - SPARQL

None

Public


Comments ( 4 )




Date: 2009-12-15 13:43
Sender: frodegill

The patch caused two regressions.
For 5.0.12, it first got a permission denied, and after granting
permissions it dumps with a double free heap error.
For 6.0, there is a problem related to returning query results as
NTriples.

Given these test-data:
INSERT INTO <http://msone.computas.no/test> {
<http://www.computas.com/mediasone-ontologi#test>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/2002/07/owl#Class> .
<http://www.computas.com/mediasone-ontologi#test>
<http://www.w3.org/2000/01/rdf-schema#label> "Test
[Test]"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://www.computas.com/mediasone-ontologi#test>
<http://www.w3.org/2000/01/rdf-schema#subClassOf>
<http://www.computas.com/mediasone-ontologi#Home> .
}

you can execute this query:
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
CONSTRUCT {
?class a owl:Class ;
rdfs:subClassOf ?super ;
rdfs:label ?label .
}
FROM <http://msone.computas.no/test>
WHERE {
?class rdfs:subClassOf ?super .
?class rdfs:label ?label .
}


For format N3/Turtle, the result is correct:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://www.computas.com/mediasone-ontologi#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
ns1:test rdf:type owl:Class .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
ns1:test rdfs:label "Test [Test]"^^xsd:string ;
rdfs:subClassOf ns1:Home .


For NTriples, the result is wrong:
<http://www.computas.com/mediasone-ontologi#test> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2000/01/rdf-schema#subClassOf>
.
<http://www.computas.com/mediasone-ontologi#test> <http://www.w3.org/2000/01/rdf-schema#label> "Test
[Test]"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://www.computas.com/mediasone-ontologi#test> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
.

(See how, for #type and #subClassOf, the returned triples are not {?s ?p
?o}, but rather {?s ?p ?p}. For #label, everything seems to be OK)


Date: 2009-11-25 18:55
Sender: iv-an-ru

Fixed in both brances, the fix will appear in the next releases. Meanwhile,
the attached patch can be tried.


Date: 2009-11-25 00:06
Sender: iv-an-ru

I've reproduced the error on current development build, In my case, I have
a valid list but "trailing" triple with rdf:nil object is missing.


Date: 2009-11-23 14:42
Sender: frodegill

For the record, the bug is also present in Virtuoso 6.0


Log in to comment.




Attached Files ( 2 )

Filename Description Download
testcase.n3 File with a working testcase. Uncomment the three commented lines to recreate the bug. Download
091125_bug2872912_fix.diff Patch for latest commercial versions, should work for other recent versions as well. Download

Changes ( 6 )

Field Old Value Date By
resolution_id None 2009-11-25 18:59 iv-an-ru
category_id None 2009-11-25 18:59 iv-an-ru
File Added 352538: 091125_bug2872912_fix.diff 2009-11-25 18:58 iv-an-ru
summary Importing turtle may fail (snapshot 20090803) 2009-11-23 14:44 frodegill
assigned_to nobody 2009-10-05 13:12 iodbc
File Added 345394: testcase.n3 2009-10-05 12:59 frodegill