I've been trying to keep an OWL ontology in the BaseX database. It's a little contrived but I thought it should work. But whenever I insert the ontology it corrupts my entire collection.

I have a single Ontology node, that initially is just an empty element. Then I perform the following query:

replace node collection('bm_test_iam')/BOT-L/Ontology with <Ontology xmlns="http://www.w3.org/2002/07/owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xml:base="http://www.w3.org/2002/07/owl#">
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <SubClassOf>
        <Class IRI="http://ar#boat"/>
        <Class IRI="http://ar#vehicle"/>
    </SubClassOf>
</Ontology>

I get an error. Same thing when I run this query from the BasX UI. This is what I see in the "Query Info" panel:

Query: replace node collection('bm_test_iam')/BOT-L/Ontology with <Ontology xmlns="http://www.w3.org/2002/07/owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xml:base="http://www.w3.org/2002/07/owl#">
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <SubClassOf>
        <Class IRI="http://ar#boat"/>
        <Class IRI="http://ar#vehicle"/>
    </SubClassOf>
</Ontology>
Error: Possible bug? Feedback is welcome: basex-talk@mailman.uni-konstanz.de
BaseX 6.3.2: 
java.lang.RuntimeException: Possible bug? Feedback is welcome: basex-talk@mailman.uni-konstanz.de
BaseX 6.3.2: 
Data Access out of bounds [pre:699, indexSize:5, access:5 > 4]

org.basex.util.Util.notexpected(Util.java:46)
org.basex.io.TableDiskAccess.cursor(TableDiskAccess.java:323)
org.basex.io.TableDiskAccess.read1(TableDiskAccess.java:92)
org.basex.data.Data.kind(Data.java:324)
org.basex.query.item.DBNode$4.next(DBNode.java:272)
org.basex.query.path.IterStep$1.next(IterStep.java:45)
org.basex.query.iter.NodeIter.next(NodeIter.java:1)
org.basex.query.path.IterPath$1.next(IterPath.java:66)
org.basex.query.path.IterPath$1.next(IterPath.java:1)
org.basex.query.up.Replace.item(Replace.java:59)
org.basex.query.expr.ParseExpr.iter(ParseExpr.java:47)
org.basex.query.QueryContext.iter(QueryContext.java:360)
org.basex.query.QueryContext.iter(QueryContext.java:324)
org.basex.query.QueryContext.eval(QueryContext.java:282)
org.basex.query.QueryProcessor.execute(QueryProcessor.java:104)
org.basex.core.cmd.AQuery.query(AQuery.java:83)
org.basex.core.cmd.XQuery.run(XQuery.java:22)
org.basex.core.Command.run(Command.java:245)
org.basex.core.Command.exec(Command.java:227)
org.basex.core.Command.execute(Command.java:66)
org.basex.gui.GUI.exec(GUI.java:383)
org.basex.gui.GUI$5.run(GUI.java:346)

Note: the XML I try to insert is created by Pellet, so I have little control over it.

Not only does the query fail, but any subsequent query on the same collection now gives me a "Possible Bug?" message. Any ideas would be greatly appreciated.

Mark Boon