File tree Expand file tree Collapse file tree 5 files changed +20
-21
lines changed
ils_middleware/tasks/folio/mappings Expand file tree Collapse file tree 5 files changed +20
-21
lines changed Original file line number Diff line number Diff line change 22BF Instance with its associated BF Work.
33"""
44
5+ editions = """PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
6+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
7+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8+ SELECT ?edition
9+ WHERE {{
10+ <{bf_instance}> a bf:Instance .
11+ <{bf_instance}> bf:editionStatement ?edition .
12+ }}
13+ """
14+
515identifier = """PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
616PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
717PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Original file line number Diff line number Diff line change 2020}}
2121"""
2222
23- editions = """PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
24- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
25- PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
26-
27- SELECT ?edition
28- WHERE {{
29- <{bf_work}> a bf:Work .
30- <{bf_work}> bf:editionStatement ?edition .
31- }}
32- """
33-
3423instance_type_id = """PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
3524
3625SELECT ?instance_type_id
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ bf:Work rdfs:label "http://id.loc.gov/ontologies/bibframe/Work" .
5858 bf:copyrightDate " ©2020" ;
5959 bf:dimensions " 30 cm by 15 cm" @en g ;
6060 bf:editionStatement " 1a edizione" @it a ;
61+ bf:editionStatement " 1st edition" @en g ;
6162 bf:electronicLocator <https://phaidra.cab.unipd.it/detail/o:445140?mycoll=o:432583> ,
6263 <https://purl.stanford.edu/mf283yt5578> ;
6364 bf:extent [ a bf:Extent ;
@@ -115,7 +116,6 @@ bf:Work rdfs:label "http://id.loc.gov/ontologies/bibframe/Work" .
115116 [ a bf:Contribution ;
116117 bf:agent <http://id.loc.gov/authorities/names/n97060063> ;
117118 bf:role <http://id.loc.gov/vocabulary/relators/aut> ] ;
118- bf:editionStatement " 1st edition" @en g ;
119119 bf:genreForm <http://id.loc.gov/authorities/genreForms/gf2014026113> ;
120120 bf:hasInstance <https://api.stage.sinopia.io/resource/b0319047-acd0-4f30-bd8b-98e6c1bac6b0> ;
121121 bf:language <http://id.loc.gov/vocabulary/languages/ita> ;
Original file line number Diff line number Diff line change 88uri = "https://api.stage.sinopia.io/resource/b0319047-acd0-4f30-bd8b-98e6c1bac6b0"
99
1010
11+ @typing .no_type_check
12+ def test_edition (test_graph : rdflib .Graph ):
13+ sparql = bf_instance_map .editions .format (bf_instance = uri )
14+
15+ editions = [row [0 ] for row in test_graph .query (sparql )]
16+ sorted_editions = sorted (editions , key = lambda x : x .value )
17+ assert str (sorted_editions [1 ]).startswith ("1st edition" )
18+
19+
1120@typing .no_type_check
1221def test_isbn (test_graph : rdflib .Graph ):
1322 sparql = bf_instance_map .identifier .format (bf_instance = uri , bf_class = "bf:Isbn" )
Original file line number Diff line number Diff line change @@ -18,15 +18,6 @@ def test_contributor_author_person(test_graph: rdflib.Graph):
1818 assert str (contributors [0 ][1 ]).startswith ("author" )
1919
2020
21- @typing .no_type_check
22- def test_edition (test_graph : rdflib .Graph ):
23- sparql = bf_work_map .editions .format (bf_work = work_uri )
24-
25- editions = [row [0 ] for row in test_graph .query (sparql )]
26-
27- assert str (editions [0 ]).startswith ("1st edition" )
28-
29-
3021@typing .no_type_check
3122def test_instance_type_id (test_graph : rdflib .Graph ):
3223 sparql = bf_work_map .instance_type_id .format (bf_work = work_uri )
You can’t perform that action at this time.
0 commit comments