Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Normalization #484

Draft
wants to merge 30 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
22d4d2d
Add initial KB base-, form- and genre-types
niklasl Apr 30, 2024
1ae2f4b
Revise KB form and genre terms
niklasl May 16, 2024
d58ff28
Add KB instance/carrier types
niklasl May 16, 2024
e7633e9
Change NewsLetter from Form to Genre
niklasl May 8, 2024
e610c94
Add RecordOrDeed as Form
niklasl May 8, 2024
bcef373
Remove inCollection (copied from matching SAOGF)
niklasl May 8, 2024
0b32ca9
Add Book equivalences
niklasl May 8, 2024
90d0622
Add more media and carrier types
niklasl May 20, 2024
02530d8
Update type mappings
niklasl Jun 3, 2024
b9b8db7
Update type mappings
niklasl Jun 5, 2024
d890614
Change use of BasicType to just Class
niklasl Jun 12, 2024
17c1ba4
Use rdfs and skos prefixes where applicable
niklasl Jun 12, 2024
074e1e5
Move types into KBV as pending concrete types
niklasl Jun 12, 2024
8dbfa62
Use simple label property for new types
niklasl Jun 12, 2024
b98f5c3
Add more labels to genre and carrier types
niklasl Jun 12, 2024
f3aec89
Add and update types to kbtf and update kbcr
niklasl Jun 28, 2024
b588929
Fix spelling in labels of new types
niklasl Jul 3, 2024
54b4aa6
Adjusted new types
niklasl Jul 8, 2024
c8aec3a
Add OWL-based type normalization examples
niklasl Aug 26, 2024
79d337e
Simplify complex types by reasoning over genreForm
niklasl Aug 27, 2024
e79e1fb
Update complex type definitions
niklasl Sep 15, 2024
3a30fe3
Change PuzzleOrGame to GenreForm
niklasl Oct 2, 2024
267511f
Add scopeNote for BookWithImages
niklasl Oct 2, 2024
e983b98
Add KBV MARC term mappings to LCGFT, SAOGF, TGM
niklasl Oct 14, 2024
2292698
Fix syntax in marcmatches.ttl
niklasl Oct 15, 2024
91198f0
Add some mappings and remarks to marcmatches.ttl
niklasl Oct 15, 2024
c674a54
Update type-normalization RDA mappings
niklasl Oct 28, 2024
4fad8f7
Update example new types
niklasl Oct 31, 2024
425b0b2
Update type-normalization classes and genre/forms
niklasl Nov 11, 2024
6b5cb58
Merge branch 'develop' into feature/typenormalization
niklasl Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/typenormalization/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cache
7 changes: 7 additions & 0 deletions examples/typenormalization/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test: cache/saogf.ttl
python test_categories.py

cache/saogf.ttl: cache
curl -s https://libris.kb.se/sparql -HAccept:text/turtle --data-urlencode 'query=PREFIX : <https://id.kb.se/vocab/> CONSTRUCT WHERE { ?a a :GenreForm ; :inScheme <https://id.kb.se/term/saogf> ; :broader ?b }' -o $@
cache:
mkdir -p cache
6 changes: 6 additions & 0 deletions examples/typenormalization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To run tests:

$ pip install -r requirements.txt
$ make test

(Add `-d` cmdline flag see full OWL-RL output.)
84 changes: 84 additions & 0 deletions examples/typenormalization/examples.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix : <https://id.kb.se/vocab/>
prefix kbgf: <https://id.kb.se/term/gf/>
prefix kbrda: <https://id.kb.se/term/rda/>
prefix saogf: <https://id.kb.se/term/saogf/>
prefix barngf: <https://id.kb.se/term/barngf/>

<book01/cmp> { <book01> a :WrittenBook }
<book01/exp> { <book01> a :Text ; :genreForm kbgf:Book ; :contentType kbrda:Text }
<book01/cmp-ext> { <book01> a :WrittenBook; :genreForm saogf:Romaner }
<book01/exp-ext> { <book01> a :Text ; :genreForm saogf:Romaner ; :contentType kbrda:Text }

<audiobook01/cmp> { <audiobook01> a :Audiobook }
<audiobook01/exp> { <audiobook01> a :Audio ; :genreForm kbgf:Book }
<audiobook01/cmp-ext> { <audiobook01> a :Audiobook ; :genreForm saogf:Ljudb%C3%B6cker }
<audiobook01/exp-ext> { <audiobook01> a :Audio ; :genreForm saogf:Ljudb%C3%B6cker }

<ebook01/cmp> { <ebook01> a :EBook }
<ebook01/exp> { <ebook01> a :Electronic ; :instanceOf [ a :Book ] }

<cdbook01/cmp> { <cdbook01> a :CDBook }
<cdbook01/exp> { <cdbook01> a :Electronic ; :carrierType kbrda:AudioDisc ; :instanceOf [ a :Book ] }

<computergame01/cmp> { <computergame01> a :ComputerGame }
<computergame01/exp> { <computergame01> a :Multimedia ; :genreForm saogf:Datorspel }

<multimedia01/exp> { <multimedia01> a :Multimedia }
<multimedia01/exp-neg> { <multimedia01> a :ComputerGame }

<serial01/cmp> { <serial01> a :Serial ; :genreForm saogf:Datorspel }
<serial01/exp> { <serial01> a :Serial ; :genreForm saogf:Datorspel }
<serial01/exp-neg> { <serial01> a :ComputerGame }

<comicmagazine01/cmp> { <comicmagazine01> a :Comic ; :genreForm kbgf:Comic }
<comicmagazine01/exp> { <comicmagazine01> a :Text ; :genreForm kbgf:Comic ; :contentType kbrda:StillImage }
<comicmagazine01/cmp-ext> { <comicmagazine01> a :Comic ; :genreForm saogf:Tecknade%20serier }
<comicmagazine01/exp-ext> { <comicmagazine01> a :Text ; :genreForm kbgf:Comic, saogf:Tecknade%20serier ; :contentType kbrda:StillImage }

<comicmagazine03/cmp> { <comicmagazine03> a :ComicIssue }
<comicmagazine03/exp> { <comicmagazine03> a :Text ; :genreForm kbgf:Comic, kbgf:Issue ; :contentType kbrda:StillImage }

<serial02/exp> { <serial02> a :Serial ; :genreForm saogf:Tecknade%20serier }
<serial02/exp-net> { <serial02> a :Comic }

<graphicnovel01/cmp> { <graphicnovel01> a :GraphicNovel }
<graphicnovel01/exp> { <graphicnovel01> a :Text, :Book ; :genreForm saogf:Serieromaner , saogf:Romaner }

<atlas/cmp> { <atlas> a :Atlas }
<atlas/exp> { <atlas> a :Cartography ; :genreForm kbgf:Book ; :contentType kbrda:Text, kbrda:CartographicImage }

<earthglobe/cmp> { <earthglobe> a :Globe }
<earthglobe/exp> { <earthglobe> a :Cartography ; :contentType kbrda:CartographicThreeDimensionalForm }

<portraitphoto/cmp> { <portraitphoto> a :Photograph ; :genreForm saogf:Portr%C3%A4tt }
<portraitphoto/exp> { <portraitphoto> a :StillImage ; :genreForm saogf:Fotografier, saogf:Portr%C3%A4tt ; :contentType kbrda:StillImage }

# TODO: :BrailleVolume :instanceOf [a :WrittenBook ] .
#<braillebook01> a :WrittenBook ;
# :genreForm saogf:Punktskriftsb%C3%B6cker ;
# spec:query 'ASK { <book03> a :TactileBook }' .
#
#<tactilefeltbook01> a :InteractiveObject ; :genreForm kbgf:TactileBook ;
# spec:query 'ASK { <tactilefeltbook01> a :TactileBook }' .

# Instance Types

# TODO: Handmade (vs. Printed)?
#<66829ddb> a :Book ; :genreForm kbgf:Manuscript .
#<66829d88> a :HandmadeVolume ; :instanceOf <66829ddb> .
#
#<66829def> a :Text ; :genreForm kbgf:Decree .
#<66829d8a> a :HandmadeSheet ; :instanceOf <66829def> .
#
#<66829e07> a :StillImage ; :genreForm kbgf:ImagePoster .
#<66829d8c> a :PrintedSheet ; :instanceOf <66829e07> .
#
#<66829e1d> a :StillImage ; :genreForm kbgf:Poster .
#<66829d8f> a :PrintedSheet ; :instanceOf <66829e1d> .
#<66829d92> a :DigitalSheet ; :instanceOf <66829e1d> .
#
#<66829d94> a :HandmadeSheet ; :instanceOf [ a :StillImage ; :genreForm kbgf:MapInPlano ] .
#<66829d97> a :DigitalVolume ; :instanceOf [ a :Book ; :genreForm kbgf:Atlas ] .
#<66829d98> a :DigitalVolume ; :instanceOf [ a :AudioBook ; :genreForm kbgf:SpokenBook ] .
Loading