Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin


Note
titleUwagaNote

The programming library for that extension is  Biblioteka programistyczna dla tego rozszerzenia to

dlproj
os
1dlibra-app-extension-mf-marc
os
.

Informacje ogólne

General information

By default, attributes from the MARC 21 communication format are imported on the basis of the configuration built into the extension. Instead of the default configuration, a configuration defined in external text files can be used. Their format is a simple set of properties. In order to indicate new configuration files for the extension, its configuration should be displayed (see the image below; displaying the configuration window is described in the configuration section). After the configuration has been displayed, the source of the new configuration (a file on the drive or a URL address) should be indicated and the “Use the configuration from the given source” option should be selected. Additionally, the character encoding for the MARC files to be imported should be specified. MARC character encoding depends on the information technology system from which such a file is importedImport atrybutów z formatu komunikacyjnego MARC 21 w rozszerzeniu MARC domyślnie opiera się na konfiguracji wbudowanej w rozszerzenie. Zamiast domyślnej konfiguracji można używać innej, zdefiniowanej w zewnętrznych plikach tekstowych. Pliki te mają format prostego zbioru właściwości. Aby wskazać nowe pliki konfiguracyjne rozszerzenia należy wyświetlić jego konfigurację (rysunek poniżej, wyświetlanie okna konfiguracji opisane jest w sekcji konfiguracja). Po wyświetleniu konfiguracji należy wskazać źródło nowej konfiguracji (plik na dysku lub adres URL) oraz zaznaczyć opcję Używaj konfiguracji z podanego źródła. Dodatkowo należy wyspecyfikować kodowanie plików MARC, które będą importowane. Kodowanie pliku MARC zależy od systemu informatycznego z którego taki plik pochodzi.

Anchor
metadataImportDialog
metadataImportDialog

labelimg
Import metadanych z formatu MARC - konfiguracja rozszerzenia
Import metadanych z formatu MARC - konfiguracja rozszerzenia

Image RemovedImage Added

Format pliku marcImport.properties

Code Block
Title=245:${a} ${b} ${n};130;210;222;240;246;730;740;
en.Title=210;222;240;246;730;740;
Creator=100;110;111;
Subject=
Description=6XX;
Publisher=260a;260b;260f;
Contributor=700;710;711;
Date=260c;
Type=
Identifier=920;856u;
Source=
Language=041;546;008/35-37;
Relation=250;534;440;490;800;810;811;830;
Coverage=
Rights=506;540;"PAN";

Powyżej przedstawiona jest zawartość przykładowego pliku konfiguracyjnego The box above contains the content of a sample marcImport.properties. W pliku tym można zdefiniować konfigurację MARC - przyporządkować wartości elementów z formatu MARC do atrybutów w systemie dLibra.Każda linia w pliku konfiguracyjnym zawiera konfigurację importu wartości dla jednego atrybutu. W każdej linii po lewej stronie znaku równości wyspecyfikowana jest nazwa RDF atrybutu do którego zostaną przypisane wartości z elementów MARC znajdujących się po prawej stronie znaku równości. Jeśli nazwa RDF atrybutu poprzedzona jest nazwą języka i kropką (np. configuration file.  In that file, the MARC configuration can be defined, that is, the values of elements from the MARC format can be assigned to attributes in the dLibra system.

In every line in the configuration file, there is an import value configuration for one attribute. In every line, on the left side of the equal sign, there is the RDF name of the attribute to which the values from the MARC elements on the right side of the equal sign will be assigned. If the RDF name is preceded by a language name and a period (for example,  en.Title=210;222;240;246;730;740;) to następująca po nazwie reguła będzie użyta do importowania metadanych do tego języka. Jeśli brakuje nazwy języka to reguła wykorzystywana jest do importowania metadanych do wybranego przez użytkownika języka (na zakładce w edytorze metadanych). Nazwa języka musi być dwuliterowym skrótem według standardu ISO 639. Nazwy RDF atrybutów można znaleźć w aplikacji administratora (panel edycyjny dotyczący atrybutu). Elementy, które można importować z formatu MARC to m. in. wartość podpola, określone znaki z pól kontrolnych itp. Brak którejkolwiek z nazw RDF atrybutów w pliku konfiguracyjnym jest równoznaczny z pozostawieniem przy tym atrybucie pustej listy numerów pól. W tej sytuacji do danego atrybutu nie zostanie zaimportowana żadna wartość.

Podstawowy zapis numerów pól MARC (lista po prawej stronie znaku równości), z których mają zostać zaimportowane wartości atrybutów w aplikacji, ma składnię: AAAb;, gdzie AAA jest trzycyfrowym numerem pola, a b jest identyfikatorem podpola. Możliwy jest również zapis łączący podpola lub pobieranie zakresu znaków z pól kontrolnych (przypadki te opisane są poniżej). Należy zwrócić uwagę, że znak ; (średnik) jest częścią niezbędną zapisu pola w konfiguracji.

Możliwe jest opuszczenie wartości podpola, jak również użycie identyfikatora wielowartościowego. Szczegóły i przykłady konfiguracji przedstawione są poniżej:

, then the rule following the name will be used for importing the metadata for that language. If there is no language name, then the rule is used for importing the metadata for the language selected by the user (in the appropriate tab in the metadata editor). The language name must be a two-letter code compliant with the ISO 639 standard. The RDF names of attributes can be found in the Administrator Application (the attribute edition panel). The elements which can be imported from the MARC format can be, for example, subfield values or particular characters from control fields. If any attribute RDF name is missing from the configuration file, then the field number list next to that attribute will be empty. In such a case, no value will be imported for that attribute.

The basic syntax of MARC field numbers (the list on the right side of the equal sign), from which the attribute values are to be imported, is as follows: AAAb;, where AAA is a three-digit field number, and b is the identifier of a subfield. It is also possible to combine subfields in a notation or to retrieve a range of characters from control fields (those cases are described below). It ought to be noted that the ; character (semicolon) is a necessary part of a field notation in a configuration.

A subfield value can be left out. Also, multi-value identifiers can be used. Here is some more detailed information about the configuration, with examples:

  • 100; – an example of how a field number can be used.
    In the case of a special field, that notation will cause the value of that field to be imported to the given attribute (it should be remembered that special fields in the MARC format, that is, fields with a value smaller than 010, do not have subfield identifiers). In the case of other fields, that notation will cause all values from all subfields of that field to be imported to the given attribute.
  • 260c; – an example of how a field number with a subfield identifier can be used.
    In the case of such a notation, only the values of a particular subfield of the given field (in this case, c of field 260) will be imported.
  • 6XX; – an example of how a multi-value identifier can be used.
    In the case of such a notation, all values of the fields and subfields from the 600–699 range will be imported. It will not be possible to specify particular subfields. Also possible is notation 65X, which will cause the field values from the 650–659 range to be imported
  • 100; - przykład użycia numeru pola.
    Taki zapis spowoduje w przypadku pola specjalnego import wartości tego pola (należy pamiętać, że pola specjalne w formacie MARC, czyli te o wartości mniejszej niż 010, nie posiadają nigdy identyfikatorów podpól) do danego atrybutu, a w przypadku pozostałych pól import wszystkich wartości występujących we wszystkich podpolach tego pola do danego atrybutu. Każda wartość podpola będzie zaimportowana jako oddzielna wartość atrybutu.
  • 260c; - przykład użycia numeru pola oraz identyfikatora podpola.
    Taki zapis spowoduje import do atrybutu tylko wartości konkretnego podpola (w tym przypadku c danego pola (w tym przypadku pola 260).
  • 6XX; - przykład użycia identyfikatora wielowartościowego.
    Taki zapis spowoduje import do atrybutu wszystkich wartości pól i ich podpól z zakresu 600 - 699. W tym przypadku nie można wyspecyfikować konkretnych podpól. Możliwy jest także przykładowo zapis 65X;, który spowoduje analogiczny import wartości pól z zakresu 650 - 659.
  • 245:${a} ${b} ${n}; - przykład łączenia podpól pola MARC w jedną wartość.
    Zapis ten możemy podzielić na dwie części, które oddzielone są od siebie znakiem : (dwukropkiem): – an example of how MARC field subfields can be combined into one value.
    That notation can be divided into two parts separated by the : character (colon):
    1. 245 – this is the number of the field the subfields of which will be combined into one value.
    2. 245 - jest to numer pola, którego podpola będą łączone w jedną wartość
      Anchor
      subfields
      subfields
    3. ${a} ${b} ${n} - jest to szablon, który definiuje w jaki sposób łączyć podpola.
      Zapis ${a} oznacza, że w jego miejsce ma zostać wstawiona wartość podpola a z pola o numerze zapisanym przez znakiem : - w tym przypadku pola 245. Zatem zapis ten spowoduje, że podpola a, b oraz n zostaną połączone w jedną wartość i będą oddzielone spacją. Przykładowo jeśli podpole 245a ma wartość wartość pierwsza, podpole 245b ma wartość wartość druga oraz podpole 245n ma wartość wartość trzecia to wynikiem takiego zapisu będzie wartość wartość pierwsza wartość druga wartość trzecia. Jeżeli chcielibyśmy aby podpola te oddzielał jakikolwiek inny znak lub ciąg znaków, wystarczy je wpisać (np. – this is a template which defines the way in which the subfields will be combined.
      Notation ${a} means that it is to be replaced with the value of subfield a from the field with the number given before the : character – in this case, field 245. Therefore, it means that subfields a, b and n will be combined into one value and will be space-separated. For example, if subfield 245a has value the first value, subfield 245b has value the second value, and subfield 245n has value the third value, then that notation will result in value the first value the second value the third value. If we want the subfields to be separated by any other character or sequence of characters, we just have to type them in, for example: 245:${a}-${b} popdole subfield n: ${n};). Wyjątkami są znaki ; (średnik), ukośnik \ oraz $ - aby te znaki zostały poprawnie zinterpretowane należy poprzedzić je ciągiem dwóch ukośników

      verbatim
      \\

      (

      np.

      for example,

      verbatim
      245:${a}${b}\\;${n};

      ). Polskie znaki diakrytyczne, oraz inne znaki spoza standardowego zestawu ASCII, muszą zostać przekonwertowane do kodów utf-8 w formacie \uXXXX, gdzie znaki X to cyfry szesnastkowe (konwerter jest dostępny np. pod adresem  Polish diacritics and other characters outside of the standard ASCII set must be converted to UTF-8 codes in the “\uXXXX” format, where the “x” characters are hexadecimal digits (the converter is available at: http://rishida.net/tools/conversion/ - część – the JavaScript escapes part).

  • 008/35-37 - dotyczy tylko pól kontrolnych - oznacza pobranie zakresu znaków z pola kontrolnego.
    Zapis ten składa się z dwóch części oddzielonych od siebie znakiem / (ukośnik): – only concerns control fields and means taking that range of characters from a control field.
    That notation consists of two parts separated with the / (slash) character:
    1. 008 – the number of the control field from which values will be taken.
    2. 35-37 – the range of characters which will be taken from the field with the number given before the slash.
      Characters 35, 36 and 37 from field 008 will be the value of that notation. If field 008 has character p in position 35, character o in position 36, and character l in position 37, then the value of that notation will be pol. If we only want to take one character from a particular position, we just have to specify that position after the / character, for example,
    3. 008 - jest to numer pola kontrolnego z którego pobrane zostaną wartości
    4. 35-37 - jest to zakres znaków jaki zostanie pobrany z pola o numerze, który występuje przed znakiem /.
      Zapis ten oznacza, że znaki 35, 36 oraz 37 z pola 008 będą wartością tego zapisu. Jeśli pole 008 na pozycji 35 ma znak p, na pozycji 36 ma znak o a na pozycji 37 ma znak l to wartością takiego zapisu będzie pol. Jeśli chcemy pobrać tylko jeden znak z okeślonej pozycji wystarczy ją wyspecyfikować po znaku /, np. 008/30.
  • "PAN"; - jest wartość stała, dodawana do atrybutu niezależnie od zawartości wczytywanego pliku marc. Stałe wartości muszą być umieszczone w cudzysłowie ". Podobnie jak w przypadku szablonów dla łączenia podpól, niektóre znaki muszą być poprzedzone dwoma ukośnikami – that is a constant value added to an attribute regardless of the content of the loaded MARC file. Constant values must be put in straight double quotation marks: ". Just like in the case of templates for combining subfields, some characters must be preceded with two slashes:

    verbatim
    \\

    : tym razem jest to cudzysłów " oraz ukośnik \. Również potrzebna jest konwersja polskich liter i innych niestandardowych znaków do kodów utf-8.

...

  •  this time, the characters are " (double quotation mark) and \ (slash). Also, Polish letters and other non-standard characters must be converted to  UTF-8 encoding.

marcImpRemChars.properties file format


Code Block
end-245b=a|b
begin-245a=OS/2
end-260c=c

Powyżej przedstawiony jest przykładowy plik konfiguracyjny The box above contains a sample configuration file marcImpRemChars.properties.

Plik ten umożliwia definiowanie ciągów znaków jakie mają być usuwane z konkretnych podpól MARC przed importowaniem ich do opisu bibliograficznego. Znaki (lub ciągi znaków) mogą być usuwane z początku (begin) lub z końca (end) podpola MARC. Ciągi znaków definiuje się używając wyrażeń regularnych. Wyrażenia regularne, które mogą być używane w mechaniźmie usuwania znaków z wartości MARC muszą być zgodne z wyrażeniami regularnymi używanymi w języku Java? (szczegóły można znaleźć tutaj).

...

That file makes it possible to define the character sequences to be removed from particular MARC subfields before they are imported to a bibliographic description. Characters (or character sequences) can be removed from the beginning (begin) or end (end) of a MARC subfield. Character strings are defined with the use of regular expressions. The regular expression which can be used in the mechanism for removing characters from MARC values must be compatible with with the regular expressions used in the Java language. (for details, see here).

Line end-245b=a|b

...

means that character a or character b will be removed from the end (the word “end”) of subfield 245b (if, off course, there is any of these characters at the end of the value of subfield 245b). The minus sign separates the determination of the place from which characters are to be removed (in this case, “end”) from the subfield from which the characters will be removed (in this case, 245b). The equal sign is followed by a specification of a regular expression (in this case, a|b) which defines what signs are to be removed.

Let us analyze the following example: begin-245a=ab. That notation will cause the Editor Application to remove the ab sequence of characters from subfield 245a – if such a sequence is found at the beginning of the value of that subfield. Thus, if field 245a in a MARC file has value abBajki, then the character removal mechanism will change it to value Bajki, and that value will be imported to the bibliographic description.

Default Configuration

By default, the extension is configured with the following files

Przeanalizujmy następujący przykład: begin-245a=ab. Zapis ten spowoduje, że program redaktora usunie z początku podpola 245a ciąg znaków ab o ile taki ciąg zostanie znaleziony na początku wartości tego podpola. Jeśli zatem w pliku MARC pole 245a będzie miało wartość abBajki to po zastosowaniu mechanizmu usuwania znaków otrzymamy Bajki i taka właśnie wartość zostanie zaimportowana do opisu bibliograficznego.

Domyślna konfiguracja

...

:

  • marcImport.properties:

    Code Block
    Title=245;130;210;222;240;246;730;740;
    Creator=100;110;111;
    Subject=
    Description=6XX;
    Publisher=260a;260b;260f;
    Contributor=700;710;711;
    Date=260c;
    Type=
    Identifier=920;856u;
    Source=
    Language=041;546;
    Relation=250;534;440;490;800;810;811;830;
    Coverage=
    Rights=506;540;
    


  • marcImpRemChars.properties
    Plik ten jest domyślnie pustyThat file is empty by default.