Skip to content

Commit 49d5610

Browse files
committed
profile and code fix
1 parent 7b508cf commit 49d5610

14 files changed

+1085
-939
lines changed

builds/bfe.dev.js

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,12 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
572572
var ampm = "a";
573573
if (min<10)
574574
min = "0"+min;
575-
if (hr>12){
576-
hr-=12;
575+
if (hr>=12){
577576
ampm = "p";
578-
}
577+
}
578+
if (hr > 12){
579+
hr-=12;
580+
}
579581
return (d.getMonth() + 1) + '-' + d.getDate() + '-' + d.getFullYear() + ' ' + hr + ':' + min + ampm;
580582
}
581583
},
@@ -606,7 +608,7 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
606608

607609
//default
608610
//var spoints = editorconfig.startingPoints[0].menuItems[0];
609-
if (rowData.profile !== "profile:bf2:Load:Work"){
611+
if (rowData.profile !== "profile:bf2:Load:Work" && rowData.profile !== "profile:bf2:IBC:Instance"){
610612
var menuIndex = _.findIndex(_(editorconfig.startingPoints).chain().find({
611613
menuItems: [{
612614
useResourceTemplates: [rowData.profile]
@@ -619,11 +621,18 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
619621
useResourceTemplates: [rowData.profile]
620622
}]
621623
}).value().menuItems[menuIndex]
622-
} else {
624+
} else if (rowData.profile === "profile:bf2:Load:Work"){
623625
var spoints = { label: "Loaded Work",
624626
type: ["http://id.loc.gov/ontologies/bibframe/Work"],
625627
useResourceTemplates:["profile:bf2:Load:Work"]
626628
};
629+
} else if (rowData.profile === "profile:bf2:IBC:Instance") {
630+
631+
var spoints = { label: "IBC",
632+
type: ["http://id.loc.gov/ontologies/bibframe/Instance"],
633+
useResourceTemplates:["profile:bf2:IBC:Instance"]
634+
};
635+
627636
}
628637

629638
var bTypes = [];
@@ -760,18 +769,38 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
760769
bfestore.loadtemplates = temptemplates;
761770
var url = $(this.parentElement).find("#bfeditor-loaduriInput").val();
762771
editorconfig.retrieve.callback(url, bfestore, bfestore.loadtemplates, bfelog, function(loadtemplates) {
772+
//converter uses bf:person intead of personal name
773+
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Person"}), function(triple) {
774+
triple.o = "http://www.loc.gov/mads/rdf/v1#PersonalName"
775+
});
776+
//converter uses bf:organization intead of corporate name
777+
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Organization"}), function(triple) {
778+
triple.o = "http://www.loc.gov/mads/rdf/v1#CorporateName"
779+
});
780+
//eliminate duplicate type bf:Contributor
781+
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bflc/PrimaryContribution"}), function(triple) {
782+
bfeditor.bfestore.store = _.reject(bfeditor.bfestore.store, _.find(bfeditor.bfestore.store, {"s":triple.s, "p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Contribution"}))
783+
});
784+
785+
//Text to Work
786+
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Text"}), function(triple) {
787+
bfeditor.bfestore.store = _.reject(bfeditor.bfestore.store, _.find(bfeditor.bfestore.store, {"s":triple.s, "p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Text"}))
788+
});
789+
763790
bfestore.loadtemplates.data = bfeditor.bfestore.store;
764791
$('[href=#create]').tab('show');
765792
$('#bfeditor-formdiv').show();
766793
if($('#bfeditor-messagediv').length){
767794
$('#bfeditor-messagediv').remove();
768795
}
769796

797+
//weird bnode prob
770798
_.each(bfeditor.bfestore.store, function(el) {
771799
if( el.o.startsWith("_:_:"))
772800
el.o = "_:" + el.o.split("_:")[2];
773-
774801
});
802+
803+
775804
cbLoadTemplates();
776805
});
777806

@@ -799,7 +828,7 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
799828

800829
var spoints = { label: "Monograph",
801830
type: ["http://id.loc.gov/ontologies/bibframe/Instance"],
802-
useResourceTemplates:["profile:bf2:Monograph:Instance"]
831+
useResourceTemplates:["profile:bf2:IBC:Instance"]
803832
};
804833

805834
bfeditor.bfestore.store = [];
@@ -838,6 +867,10 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
838867
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Person"}), function(triple) {
839868
triple.o = "http://www.loc.gov/mads/rdf/v1#PersonalName"
840869
});
870+
//converter uses bf:organization intead of corporate name
871+
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Organization"}), function(triple) {
872+
triple.o = "http://www.loc.gov/mads/rdf/v1#CorporateName"
873+
});
841874
//eliminate duplicate type bf:Contributor
842875
_.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bflc/PrimaryContribution"}), function(triple) {
843876
bfeditor.bfestore.store = _.reject(bfeditor.bfestore.store, _.find(bfeditor.bfestore.store, {"s":triple.s, "p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "o": "http://id.loc.gov/ontologies/bibframe/Contribution"}))
@@ -853,6 +886,22 @@ bfe.define('src/bfe', ['require', 'exports', 'module', 'src/bfestore', 'src/bfel
853886
bfeditor.bfestore.store = _.reject(bfeditor.bfestore.store, _.find(bfeditor.bfestore.store, {"p":"http://id.loc.gov/ontologies/bflc/itemOf"}));
854887
}
855888

889+
_.each(_.where(bfeditor.bfestore.store, {"p": "http://id.loc.gov/ontologies/bibframe/adminMetadata"}), function(am){;
890+
var adminTriple = {};
891+
adminTriple.s = am.o;
892+
adminTriple.p = "http://id.loc.gov/ontologies/bflc/profile";
893+
adminTriple.o = bfeditor.bfestore.profile;
894+
adminTriple.otype = "literal";
895+
bfeditor.bfestore.store.push(adminTriple)
896+
897+
adminTriple = {};
898+
adminTriple.s = am.o;
899+
adminTriple.p = "http://id.loc.gov/ontologies/bflc/procInfo";
900+
adminTriple.o = "ibc update";
901+
adminTriple.otype = "literal";
902+
bfeditor.bfestore.store.push(adminTriple)
903+
});
904+
856905
// _.each(_.where(bfeditor.bfestore.store, {"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}), function(triple) {
857906
// _.each(_.where(bfeditor.bfestore.store, {"s":triple.s, "p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}), function (typeTriple){
858907
// console.log(typeTriple.s + typeTriple.o);
@@ -3553,9 +3602,9 @@ bfe.define('src/bfestore', ['require', 'exports', 'module'], function(require, e
35533602
data = data.replace(/xmlns:ns1=/g, "xmlns:bf=");
35543603
data = data.replace(/ns1:/g, "bf:");
35553604

3556-
data = data.replace(/xmlns:ns2=/g, "xmlns:madsrdf=");
3605+
//data = data.replace(/xmlns:ns2=/g, "xmlns:madsrdf=");
35573606
data = data.replace(/ns2:/g, "madsrdf:");
3558-
3607+
data = data.replace(/xmlns:ns2=\"madsrdf:\"/g, "");
35593608
callback(data)
35603609
},
35613610
error: function(XMLHttpRequest, status, err) {
@@ -4155,9 +4204,16 @@ bfe.define('src/lookups/lcshared', ['require', 'exports', 'module'], function(re
41554204
for (var s = 0; s < suggestions[1].length; s++) {
41564205
var l = suggestions[1][s];
41574206
var u = suggestions[3][s];
4207+
if (suggestions.length ===5){
4208+
var i = suggestions[4][s];
4209+
var li = l + " ("+i+")";
4210+
} else {
4211+
var li = l;
4212+
}
4213+
41584214
typeahead_source.push({
41594215
uri: u,
4160-
value: l
4216+
value: li
41614217
});
41624218
}
41634219
}

static/js/config-dev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
"static/profiles/bibframe/BIBFRAME 2.0 Rare Materials.json",
259259
"static/profiles/bibframe/BIBFRAME 2.0 Sound Recording: Audio CD-R.json",
260260
"static/profiles/bibframe/BIBFRAME 2.0 Load.json",
261+
"static/profiles/bibframe/BIBFRAME 2.0 IBC.json"
261262
],
262263
"startingPoints": [
263264
{"menuGroup": "Monograph",

static/profiles/bibframe/BIBFRAME 2.0 Agents.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@
5555
"propertyLabel": "Fuller Form of Name (RDA 9.5) CORE IF ...",
5656
"remark": "http://www.loc.gov/mads/rdf/v1#"
5757
},
58-
{
59-
"mandatory": "false",
60-
"repeatable": "true",
61-
"type": "literal",
62-
"resourceTemplates": [],
63-
"valueConstraint": {
64-
"valueTemplateRefs": [],
65-
"useValuesFrom": [],
66-
"valueDataType": {}
67-
},
68-
"propertyURI": "http://www.loc.gov/mads/rdf/v1#classification",
69-
"propertyLabel": "Classification number"
70-
},
7158
{
7259
"mandatory": "false",
7360
"repeatable": "true",

static/profiles/bibframe/BIBFRAME 2.0 Cartographic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@
850850
"resourceTemplates": [],
851851
"valueConstraint": {
852852
"valueTemplateRefs": [
853-
"profile:bf2:Cartography:Item"
853+
"profile:bf2:Cartographic:Item"
854854
],
855855
"useValuesFrom": [],
856856
"valueDataType": {}

static/profiles/bibframe/BIBFRAME 2.0 Form.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{
3434
"mandatory": "false",
3535
"repeatable": "false",
36-
"type": "lookup",
36+
"type": "resource",
3737
"resourceTemplates": [],
3838
"valueConstraint": {
3939
"valueTemplateRefs": [],
@@ -45,11 +45,12 @@
4545
"dataTypeURI": "",
4646
"remark": "http://id.loc.gov/ontologies/bibframe/GeographicCoverage"
4747
},
48-
"repeatable": "false"
48+
"repeatable": "false",
49+
"remark": "http://id.loc.gov/ontologies/bflc/target"
4950
},
5051
"propertyLabel": "(Geographic) Coverage of the Content (RDA 7.3)",
5152
"remark": "http://access.rdatoolkit.org/7.3.html",
52-
"propertyURI": "http://id.loc.gov/ontologies/bflc/target"
53+
"propertyURI": "http://id.loc.gov/ontologies/bibframe/GeographicCoverage"
5354
},
5455
{
5556
"mandatory": "false",

static/profiles/bibframe/BIBFRAME 2.0 Moving Image: 35mm Feature Film.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@
656656
"useValuesFrom": [],
657657
"valueDataType": {}
658658
},
659-
"propertyLabel": "Credits",
659+
"propertyLabel": "Cast/Credits",
660660
"remark": "http://access.rdatoolkit.org/2.17.3.5.html",
661661
"propertyURI": "http://id.loc.gov/ontologies/bibframe/credits"
662662
},
@@ -1280,12 +1280,12 @@
12801280
"valueDataType": {}
12811281
},
12821282
"propertyURI": "http://www.w3.org/2000/01/rdf-schema#label",
1283-
"propertyLabel": "Credits note"
1283+
"propertyLabel": "Cast/credits note"
12841284
}
12851285
],
12861286
"id": "profile:bf2:35mmFeatureFilm:Credits",
12871287
"resourceURI": "http://id.loc.gov/ontologies/bibframe/Credits",
1288-
"resourceLabel": "Credits note"
1288+
"resourceLabel": "Cast/Credits note"
12891289
},
12901290
{
12911291
"propertyTemplates": [
@@ -1519,7 +1519,7 @@
15191519
{
15201520
"mandatory": "false",
15211521
"repeatable": "true",
1522-
"type": "lookup",
1522+
"type": "target",
15231523
"resourceTemplates": [],
15241524
"valueConstraint": {
15251525
"valueTemplateRefs": [],
@@ -1533,7 +1533,7 @@
15331533
},
15341534
"propertyLabel": "Sound Content (RDA 7.18)",
15351535
"remark": "http://access.rdatoolkit.org/7.18.html",
1536-
"propertyURI": "http://www.w3.org/1999/02/22-rdf-syntax-ns#value"
1536+
"propertyURI": "http://id.loc.gov/ontologies/bflc/target"
15371537
},
15381538
{
15391539
"mandatory": "false",
@@ -1639,7 +1639,7 @@
16391639
{
16401640
"mandatory": "false",
16411641
"repeatable": "true",
1642-
"type": "lookup",
1642+
"type": "target",
16431643
"resourceTemplates": [],
16441644
"valueConstraint": {
16451645
"valueTemplateRefs": [],
@@ -1651,7 +1651,7 @@
16511651
"remark": "http://id.loc.gov/ontologies/bibframe/PlaybackChannels"
16521652
}
16531653
},
1654-
"propertyURI": "http://www.w3.org/1999/02/22-rdf-syntax-ns#value",
1654+
"propertyURI": "http://id.loc.gov/ontologies/bflc/target",
16551655
"propertyLabel": "Configuration of Playback Channels (RDA 3.16.8)",
16561656
"remark": "http://access.rdatoolkit.org/3.16.8.html"
16571657
},
@@ -1681,7 +1681,7 @@
16811681
{
16821682
"mandatory": "false",
16831683
"repeatable": "true",
1684-
"type": "lookup",
1684+
"type": "target",
16851685
"resourceTemplates": [],
16861686
"valueConstraint": {
16871687
"valueTemplateRefs": [],
@@ -1693,7 +1693,7 @@
16931693
"remark": "http://id.loc.gov/ontologies/bibframe/PlaybackCharacteristic"
16941694
}
16951695
},
1696-
"propertyURI": "http://www.w3.org/1999/02/22-rdf-syntax-ns#value",
1696+
"propertyURI": "http://id.loc.gov/ontologies/bflc/target",
16971697
"propertyLabel": "Special Playback Characteristic (RDA 3.16.9)",
16981698
"remark": "http://access.rdatoolkit.org/3.16.9.html"
16991699
}

0 commit comments

Comments
 (0)