cite-architecture / citeobj

Collections of citable objects
1 stars 0 forks source link

Can't build CiteLibrary with more than one collection item. #17

Closed Eumaeus closed 7 years ago

Eumaeus commented 7 years ago

This code:

val cex = """#!citelibrary
name#demo
urn#urn:cite2:cex:testcoll:hdt1node
license#public domain

#!ctscatalog

urn#citationScheme#groupName#workTitle#versionLabel#exemplarLabel#online
urn:cts:greekLit:tlg0016.tlg001.loebeng:#book/section#Herodotus#Histories#English. trans. Godley [1921]##true

#!ctsdata

urn:cts:greekLit:tlg0016.tlg001.loebeng:1.0#This is the Showing forth of the Inquiry of Herodotus of Halicarnassos, to the end that neither the deeds of men may be forgotten by lapse of time, nor the works great and marvellous, which have been produced some by Hellenes and some by Barbarians, may lose their renown; and especially that the causes may be remembered for which these waged war with one another.

#!citelibrary
name#demo
urn#urn:cite2:cex:testcoll:hdt1node
license#public domain

#!citecatalog
collection#urn:cite2:hmt:msA.v1:#Pages of the Venetus A manuscriptscript#urn:cite2:hmt:msA.v1.label:#urn:cite2:hmt:msA.v1.sequence:#CC-attribution-share-alike

property#urn:cite2:hmt:msA.v1.urn:#URN#Cite2Urn#
property#urn:cite2:hmt:msA.v1.label:#Label#String#
property#urn:cite2:hmt:msA.v1.siglum:#Manuscript siglum#String#
property#urn:cite2:hmt:msA.v1.sequence:#Page sequence#Number#
property#urn:cite2:hmt:msA.v1.rv:#Recto or Verso#String#recto,verso
property#urn:cite2:hmt:msA.v1.codex:#Codex URN#Cite2Urn#

#!citedata
siglum#sequence#urn#rv#label#codex
msA#1#urn:cite2:hmt:msA.v1:1r#recto#Marcianus Graecus Z. 454 (= 822) (Venetus A) folio 1r#urn:cite2:hmt:codex:msA
msA#2#urn:cite2:hmt:msA.v1:1v#verso#Marcianus Graecus Z. 454 (= 822) (Venetus A) folio 1v#urn:cite2:hmt:codex:msA
msA#3#urn:cite2:hmt:msA.v1:2r#recto#Marcianus Graecus Z. 454 (= 822) (Venetus A) folio 2r#urn:cite2:hmt:codex:msA
"""

val citeRepo = CiteLibrary(cex,"#",",")

Throws an error:

java.lang.AssertionError: assertion failed: For urn:cite2:hmt:msA.v1.urn:, found 3 matches
  at scala.Predef$.assert(Predef.scala:170)
  at edu.holycross.shot.citeobj.CiteCollectionRepository.citableObject(CiteCollectionRepository.scala:40)
  at edu.holycross.shot.citeobj.CiteCollectionRepository.objectValidates(CiteCollectionRepository.scala:99)
  at edu.holycross.shot.citeobj.CiteCollectionRepository$$anonfun$2.apply(CiteCollectionRepository.scala:25)
  at edu.holycross.shot.citeobj.CiteCollectionRepository$$anonfun$2.apply(CiteCollectionRepository.scala:24)
  at scala.collection.immutable.Set$Set1.foreach(Set.scala:94)
  at edu.holycross.shot.citeobj.CiteCollectionRepository.<init>(CiteCollectionRepository.scala:24)
  at edu.holycross.shot.citeobj.CiteCollectionRepository$.apply(CiteCollectionRepository.scala:139)
  at edu.holycross.shot.scm.CiteLibrary$.collectionRepoFromCex(CiteLibrary.scala:78)
  at edu.holycross.shot.scm.CiteLibrary$.apply(CiteLibrary.scala:93)

Editing the end of the cex-string thus does work:

…
#!citedata
siglum#sequence#urn#rv#label#codex
msA#1#urn:cite2:hmt:msA.v1:1r#recto#Marcianus Graecus Z. 454 (= 822) (Venetus A) folio 1r#urn:cite2:hmt:codex:msA
"""
neelsmith commented 7 years ago

can't reproduce the result from the example given here. Did you paste in the succeeding data rather than the failing data?

neelsmith commented 7 years ago

Seems to be version conflicts. Have posted a working build set up with compatible versions, so closing this, at least for now.