Dear all,

I have some code that write hundreds of thousands of trig files
(converting some XML data to RDF). I recently introduced a relatively
minor change: some literals are now in a custom datatype, defined
here:

https://github.com/buda-base/xmltoldmigration/blob/9cc469de4c99c5f6f8f554ef1318d45de916534e/src/main/java/io/bdrc/xmltoldmigration/xml2files/CommonMigration.java#L121

(Is there a more simple way to just add a datatype to a Literal? I
really don't do anything special with these and treat them like
strings)

But now, I'm getting this exception:

Exception in thread "main" org.apache.jena.shared.BrokenException: oh
dear, already have a slot for
io.bdrc.xmltoldmigration.xml2files.CommonMigration$EDTFStr@3568ea59,
viz 54
    at org.apache.jena.mem.HashedBunchMap.grow(HashedBunchMap.java:109)
    at org.apache.jena.mem.HashedBunchMap.put$(HashedBunchMap.java:90)
    at org.apache.jena.mem.HashedBunchMap.put(HashedBunchMap.java:70)
    at org.apache.jena.mem.NodeToTriplesMapMem.add(NodeToTriplesMapMem.java:51)
    at 
org.apache.jena.mem.GraphTripleStoreBase.add(GraphTripleStoreBase.java:63)
    at org.apache.jena.mem.GraphMem.performAdd(GraphMem.java:37)
    at org.apache.jena.graph.impl.GraphBase.add(GraphBase.java:184)
    at org.apache.jena.sparql.graph.GraphWrapper.add(GraphWrapper.java:39)
    at java.base/java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:1032)
    at 
org.apache.jena.graph.GraphUtil.addIteratorWorkerDirect(GraphUtil.java:153)
    at org.apache.jena.graph.GraphUtil.addIteratorWorker(GraphUtil.java:145)
    at org.apache.jena.graph.GraphUtil.addInto(GraphUtil.java:139)
    at 
org.apache.jena.sparql.core.DatasetGraphTriplesQuads.addGraph(DatasetGraphTriplesQuads.java:80)
    at 
io.bdrc.xmltoldmigration.MigrationHelpers.modelToOutputStream(MigrationHelpers.java:584)

Which I don't understand... is it a hash collision?

What puzzles me is that this is triggered on an operation that doesn't
create new data:

https://github.com/buda-base/xmltoldmigration/blob/9cc469de4c99c5f6f8f554ef1318d45de916534e/src/main/java/io/bdrc/xmltoldmigration/MigrationHelpers.java#L584

The value of Model m at this point is attached in TTL, notice that it
contains the same literal twice:

"12XX"^^<http://id.loc.gov/datatypes/edtf>

Could this be the issue? If so, what's the best way to deal with it?

Thanks in advance,
-- 
Elie
@prefix :      <http://purl.bdrc.io/ontology/core/> .
@prefix bdg:   <http://purl.bdrc.io/graph/> .
@prefix bf:    <http://id.loc.gov/ontologies/bibframe/> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix skos:  <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix adm:   <http://purl.bdrc.io/ontology/admin/> .
@prefix rkts:  <http://purl.rkts.eu/resource/> .
@prefix bdr:   <http://purl.bdrc.io/resource/> .
@prefix bdu:   <http://purl.bdrc.io/resource-nc/user/> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bda:   <http://purl.bdrc.io/admindata/> .

bda:LG7AD4C61963938A56
        a               adm:UpdateData ;
        adm:logDate     "2013-11-08T13:38:37.684Z"^^xsd:dateTime ;
        adm:logMessage  "added note"@en ;
        adm:logWho      bdu:U00007 .

bdr:NTE898A2CF1A3CC42C
        a                          :Note ;
        :contentLocationStatement  "p. 14" ;
        :noteSource                bdr:MW20520 ;
        :noteText                  "སྤོ་བོ་དཔོན་རྒན་ཨ་ཉག་གི་སྲས་དཔའ་རྩལ་བློ་གྲོས་བཟང་པོས་བཞེངས་པ་སྟེ། དེས་ཐོག་མར་གསེར་ཁང་དཀོན་གཉེར་དཔོན་པོའི་ཚུལ་བཟུང་ནས་འདོམས་ཆུ་བྱམས་པ་ལྷ་ཁང་གི་སྐུ་མཁར་ཕོ་བྲང་བརྩེགས་ཤིང་བཞུགས་པ་སོགས་འཁོད། ༡༦༤༠ལོ་ཙམ་དུ་སོག་དམག་གིས་གཏོར། བསྐྱར་བཞེངས་ཡོད་ངེས་ཀྱང་་ཞིབ་ཆའི་གནས་ས་གཅིག་ཡིན་མིན་མུ་མཐུད་དཔྱད་བྱའོ།"@bo .

bda:LGCEAAEE59EAB9390D
        a               adm:InitialDataCreation ;
        adm:logDate     "2013-11-08T13:26:25.177Z"^^xsd:dateTime ;
        adm:logMessage  "created record & added note"@en ;
        adm:logWho      bdu:U00007 .

bdr:EVE3F7E9413AF67127
        a           :PlaceFounded ;
        :eventWhen  "12XX"^^<http://id.loc.gov/datatypes/edtf> ;
        :eventWho   bdr:P3CN7 ;
        :notAfter   "1299"^^xsd:gYear ;
        :notBefore  "1200"^^xsd:gYear .

bda:LGB8FBC785E1D2A9B2
        a               adm:UpdateData ;
        adm:logDate     "2013-11-08T14:18:24.904Z"^^xsd:dateTime ;
        adm:logMessage  "added note"@en ;
        adm:logWho      bdu:U00007 .

bdr:EVD66FFF5DEBE11F62
        a           :PlaceFounded ;
        :eventWhen  "12XX"^^<http://id.loc.gov/datatypes/edtf> ;
        :notAfter   "1299"^^xsd:gYear ;
        :notBefore  "1200"^^xsd:gYear .

bdr:EV1C124E7B787EBEC8
        a        :PlaceDestroyed ;
        :onYear  "1640"^^xsd:gYear .

bda:G3CN6  a               adm:AdminData ;
        adm:adminAbout     bdr:G3CN6 ;
        adm:facetIndex     10 ;
        adm:gitPath        "48/G3CN6.trig" ;
        adm:gitRepo        bda:GR0005 ;
        adm:graphId        bdg:G3CN6 ;
        adm:logEntry       bda:LG7AD4C61963938A56 , bda:LGCEAAEE59EAB9390D , bda:LGB8FBC785E1D2A9B2 , bda:LG59DB2503B3E87235 ;
        adm:metadataLegal  bda:LD_BDRC_CC0 ;
        adm:status         bda:StatusReleased ;
        :isRoot            true .

bdr:G3CN6  a             :Place ;
        :isRoot          true ;
        :note            bdr:NTE898A2CF1A3CC42C ;
        :placeEvent      bdr:EVE3F7E9413AF67127 , bdr:EVD66FFF5DEBE11F62 , bdr:EV1C124E7B787EBEC8 , bdr:EV08B4A372BF0AE640 ;
        :placeIsNear     bdr:G1KR1885 ;
        :placeLocatedIn  bdr:G655 , bdr:G2944 ;
        :placeType       bdr:PT0051 ;
        skos:altLabel    "kaHgnam rgyal po'i pho brang /"@bo-x-ewts , "kaHgnam sde pa'i pho brang /"@bo-x-ewts , "kaH gnam pa'i pho brang srin po rdzong /"@bo-x-ewts ;
        skos:prefLabel   "kaHgnam pho brang /"@bo-x-ewts .

bda:LG59DB2503B3E87235
        a               adm:UpdateData ;
        adm:logDate     "2013-11-08T13:49:37.601Z"^^xsd:dateTime ;
        adm:logMessage  "added event"@en ;
        adm:logWho      bdu:U00007 .

bdr:EV08B4A372BF0AE640
        a           :PlaceRebuilt ;
        :eventWhen  "16XX"^^<http://id.loc.gov/datatypes/edtf> ;
        :notAfter   "1699"^^xsd:gYear ;
        :notBefore  "1600"^^xsd:gYear .

Reply via email to