@@ -459,18 +459,19 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
459459 text = _ . find ( data , "http://id.loc.gov/ontologies/bibframe/title" ) [ "http://id.loc.gov/ontologies/bibframe/title" ] ;
460460 //return text["http://id.loc.gov/ontologies/bibframe/title"][0]["@value"];
461461 if ( text !== undefined )
462- if ( text [ 0 ] !== undefined )
463- if ( text [ 0 ] [ "@id" ] !== undefined ) {
464- id = text [ 0 ] [ "@id" ]
462+ _ . each ( text , function ( el ) {
463+ if ( el [ "@id" ] !== undefined ) {
464+ id = el [ "@id" ]
465465 title = _ . where ( data , {
466466 "@id" : id
467467 } ) ;
468-
468+
469469 if ( _ . has ( title [ 0 ] , "http://id.loc.gov/ontologies/bibframe/mainTitle" ) )
470470 retval = title [ 0 ] [ "http://id.loc.gov/ontologies/bibframe/mainTitle" ] [ 0 ] [ "@value" ] ;
471471 else if ( _ . has ( title [ 0 ] , "http://www.w3.org/2000/01/rdf-schema#label" ) )
472472 retval = title [ 0 ] [ "http://www.w3.org/2000/01/rdf-schema#label" ] [ 0 ] [ "@value" ] ;
473473 }
474+ } ) ;
474475 } else if ( _ . some ( data , "http://www.loc.gov/mads/rdf/v1#authoritativeLabel" ) ) {
475476 retval = _ . find ( data , "http://www.loc.gov/mads/rdf/v1#authoritativeLabel" ) [ "http://www.loc.gov/mads/rdf/v1#authoritativeLabel" ] [ 0 ] [ "@value" ]
476477 if ( retval === undefined )
@@ -732,7 +733,7 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
732733
733734 var spoints = { label : "Loaded Work" ,
734735 type : [ "http://id.loc.gov/ontologies/bibframe/Work" ] ,
735- useResourceTemplates :[ "profile:bf2:Load :Work" ]
736+ useResourceTemplates :[ "profile:bf2:Monograph :Work" ]
736737 } ;
737738
738739 bfeditor . bfestore . store = [ ] ;
@@ -765,6 +766,12 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
765766 if ( $ ( '#bfeditor-messagediv' ) . length ) {
766767 $ ( '#bfeditor-messagediv' ) . remove ( ) ;
767768 }
769+
770+ _ . each ( bfeditor . bfestore . store , function ( el ) {
771+ if ( el . o . startsWith ( "_:_:" ) )
772+ el . o = "_:" + el . o . split ( "_:" ) [ 2 ] ;
773+
774+ } ) ;
768775 cbLoadTemplates ( ) ;
769776 } ) ;
770777
@@ -1513,7 +1520,7 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
15131520 //$formgroup.append($saves);
15141521 }
15151522
1516- if ( property . type === "resource" || property . type === "lookup" ) {
1523+ if ( property . type === "resource" || property . type === "lookup" || property . type === "target" ) {
15171524
15181525 if ( _ . has ( property , "valueConstraint" ) ) {
15191526 if ( _ . has ( property . valueConstraint , "valueTemplateRefs" ) && ! _ . isEmpty ( property . valueConstraint . valueTemplateRefs ) ) {
@@ -2451,7 +2458,7 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
24512458 adminTriple . s = resourceURI ;
24522459 adminTriple . p = "http://id.loc.gov/ontologies/bibframe/creationDate" ;
24532460 var d = new Date ( bfeditor . bfestore . created ) ;
2454- adminTriple . o = d . getFullYear ( ) + '-' + d . getMonth ( ) + 1 + '-' + d . getDate ( ) ;
2461+ adminTriple . o = d . getFullYear ( ) + '-' + ( d . getMonth ( ) + 1 ) + '-' + d . getDate ( ) ;
24552462 adminTriple . otype = "literal" ;
24562463 triplespassed . push ( adminTriple ) ;
24572464 bfeditor . bfestore . store . push ( adminTriple )
0 commit comments