def test_jsonld(self, book_context): record = { 'recid': '1234', 'rero_id': 'http://data.rero.ch/01-R1234' } converted = record2jsonld(record, book_context) assert converted[0].get('@id') == 'http://doc.rero.ch/record/1234'
def test_jsonld(book_context): record = {'recid': '1234', 'isbn10': '2-88147-009-2'} converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/ontology/bibo/isbn10': [{ '@value': '2-88147-009-2' }] }]
def test_jsonld(book_context): record = {'recid': '1234', 'isbn': '9782882250209'} converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/ontology/bibo/isbn13': [{ '@value': '9782882250209' }] }]
def test_jsonld(self, book_context): record = {"recid": "1234", "other_title": {"maintitle": "Other Title", "lang": "en", "full": "Other Title"}} converted = record2jsonld(record, book_context) jsonld = [ { "@id": "http://doc.rero.ch/record/1234", "http://purl.org/dc/terms/alternative": [{"@value": "Other Title", "@language": "en"}], } ] assert converted == jsonld
def test_jsonld(book_context): record = {'recid': '1234', 'language': 'en'} converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/language': [{ '@value': 'en' }] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'isbn10': '2-88147-009-2' } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/ontology/bibo/isbn10': [{ '@value': '2-88147-009-2' }] }]
def test_jsonld(self, book_context): record = { 'recid': '1234', 'media_type': 'http://rdvocab.info/termList/RDAMediaType/1003' } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://rdaregistry.info/Elements/u/mediaType': [{ '@id': 'http://rdvocab.info/termList/RDAMediaType/1003' }] }]
def test_jsonld(book_context): record = {'recid': '1234', 'reroid': 'http://data.rero.ch/01-R1234'} converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/hasFormat': [{ '@id': 'http://data.rero.ch/01-R1234' }] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'rero_id': 'http://data.rero.ch/01-R1234' } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/hasFormat': [{ '@id': 'http://data.rero.ch/01-R1234' }] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'language': 'en' } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/language': [{ '@value': 'en' }] }] assert converted == jsonld
def test_jsonld(book_context): record = {'recid': '1234', 'type': ['bibrec', 'book', 'text']} converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', '@type': [ 'http://purl.org/dc/terms/BibliographicResource', 'http://purl.org/ontology/bibo/Book', 'http://purl.org/dc/dcmitype/Text', ] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'corporate': ['Corporate name', 'Corporate name2'] } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/contributor': [{ '@value': 'Corporate name' }, { '@value': 'Corporate name2' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'media_type': 'http://rdvocab.info/termList/RDAMediaType/1003' } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://rdaregistry.info/Elements/u/mediaType': [{ '@id': 'http://rdvocab.info/termList/RDAMediaType/1003' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'publication_date': { 'from': 2015, 'to': 2016, 'full': '2015-2016' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/issued': [{ '@value': '2015-2016' }] }]
def test_jsonld(self, book_context): record = { 'recid': '1234', 'series': { 'name': 'Name', 'volume': '3', 'full': 'Name ; 3' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/bibliographicCitation': [{ '@value': 'Name ; 3' }] }]
def test_jsonld(self, book_context): record = { 'recid': '1234', 'publication_date': { 'from': 2015, 'to': 2016, 'full': '2015-2016' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/issued': [{ '@value': '2015-2016' }] }]
def test_jsonld(self, book_context): record = { 'recid': '1234', 'edition': { 'name': 'Name', 'remainder': 'Remainder', 'full': 'Name Remainder' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/ontology/bibo/edition': [{ '@value': 'Name Remainder' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'corporate': ['Corporate name', 'Corporate name2'] } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/contributor': [{ '@value': 'Corporate name' }, { '@value': 'Corporate name2' }] }]
def test_jsonld(self, book_context): record = { "recid": "1234", "collation": { "pages": "100 p.", "other": "ill.", "dimension": "25 x 30 cm", "full": "100 p. ill. 25 x 30 cm", }, } converted = record2jsonld(record, book_context) assert converted == [ { "@id": "http://doc.rero.ch/record/1234", "http://purl.org/dc/elements/1.1/format": [{"@value": "100 p. ill. 25 x 30 cm"}], } ]
def test_jsonld(book_context): record = { 'recid': '1234', 'edition': { 'name': 'Name', 'remainder': 'Remainder', 'full': 'Name Remainder' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/ontology/bibo/edition': [{ '@value': 'Name Remainder' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'series': { 'name': 'Name', 'volume': '3', 'full': 'Name ; 3' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/bibliographicCitation': [{ '@value': 'Name ; 3' }] }]
def test_jsonld(self, book_context): record = { 'recid': '1234', 'meeting': { 'name': 'Name', 'location': 'Location', 'date': '2015', 'number': '34', 'full': 'Name 34 2015 Location' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/contributor': [{ '@value': 'Name 34 2015 Location' }] }]
def test_first_author_jsonld(book_context): record = { 'recid': '1234', 'contributor': [{ 'name': 'LastName, FirstName', 'date': '1971-', 'role': 'Dir.', 'affilation': 'Affiliation', 'full': 'LastName, FirstName 1971-' }] } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/creator': [{ '@value': 'LastName, FirstName 1971-' }] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'publication': { 'location': 'Location', 'publisher': 'Publisher', 'date': '2015-', 'print_location': 'Print Location', 'printer': 'Printer', 'full': 'Location Publisher 2015- Print Location Printer' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://rdaregistry.info/Elements/u/publicationStatement': [{ '@value': 'Location Publisher 2015- Print Location Printer' }] }]
def test_first_author_jsonld(self, book_context): record = { 'recid': '1234', 'authors': [{ 'name': 'LastName, FirstName', 'date': '1971-', 'role': 'Dir.', 'affilation': 'Affiliation', 'full': 'LastName, FirstName 1971-' }] } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/creator': [{ '@value': 'LastName, FirstName 1971-' }] }] assert converted == jsonld
def test_jsonld(book_context): record = { 'recid': '1234', 'collation': { 'pages': '100 p.', 'other': 'ill.', 'dimension': '25 x 30 cm', 'full': '100 p. ill. 25 x 30 cm' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/format': [{ '@value': '100 p. ill. 25 x 30 cm' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'other_title': { 'maintitle': 'Other Title', 'lang': 'en', 'full': 'Other Title' } } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/alternative': [{ '@value': 'Other Title', '@language': 'en' }] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'title': { 'maintitle': 'Main Title', 'subtitle': 'Subtitle', 'lang': 'en', 'full': 'Main Title Subtitle' } } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/title': [{ '@value': 'Main Title Subtitle', '@language': 'en' }] }] assert converted == jsonld
def test_jsonld(self, book_context): record = { 'recid': '1234', 'udc': { 'code': '004', 'en': 'Computer science', 'fr': 'Informatique', 'de': 'Informatik', 'it': "Informatique", 'uri': ['http://udcdata.info/013566'] } } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/subject': [{ '@id': 'http://udcdata.info/013566' }] }] assert converted == jsonld
def test_jsonld(book_context): record = { 'recid': '1234', 'meeting': { 'name': 'Name', 'location': 'Location', 'date': '2015', 'number': '34', 'full': 'Name 34 2015 Location' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/elements/1.1/contributor': [{ '@value': 'Name 34 2015 Location' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'publication': { 'location': 'Location', 'publisher': 'Publisher', 'date': '2015-', 'print_location': 'Print Location', 'printer': 'Printer', 'full': 'Location Publisher 2015- Print Location Printer' } } converted = record2jsonld(record, book_context) assert converted == [{ '@id': 'http://doc.rero.ch/record/1234', 'http://rdaregistry.info/Elements/u/publicationStatement': [{ '@value': 'Location Publisher 2015- Print Location Printer' }] }]
def test_jsonld(book_context): record = { 'recid': '1234', 'udc': { 'code': '004', 'en': 'Computer science', 'fr': 'Informatique', 'de': 'Informatik', 'it': "Informatique", 'uri': ['http://udcdata.info/013566'] } } converted = record2jsonld(record, book_context) jsonld = [{ '@id': 'http://doc.rero.ch/record/1234', 'http://purl.org/dc/terms/subject': [{ '@id': 'http://udcdata.info/013566' }] }] assert converted == jsonld
def test_jsonld(book_context): record = {'recid': '1234', 'rero_id': 'http://data.rero.ch/01-R1234'} converted = record2jsonld(record, book_context) assert converted[0].get('@id') == 'http://doc.rero.ch/record/1234'