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

Fix invalid syntax #70

Merged
merged 3 commits into from
Feb 8, 2023
Merged
Changes from 1 commit
Commits
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
28 changes: 14 additions & 14 deletions pages/query/picapath.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ created: 2014
creator: Jakob Voß
---

Mit **PICA Path** Ausdrücken lassen sich einzelne Felder, Unterfelder und Feldinhalte von [PICA](../pica)-Daten referenzieren. Das Format ist von [MARCSpec](marcspec) inspiriert und wird im Rahmen der Werkzeuge [picadata](https://metacpan.org/dist/PICA-Data/view/script/picadata), Catmandu und [pica-rs](https://github.com/deutsche-nationalbibliothek/pica-rs) entwickelt.
Mit **PICA Path** Ausdrücken lassen sich einzelne Felder, Unterfelder und Feldinhalte von [PICA](../pica)-Daten referenzieren. Das Format ist von [MARCSpec](marcspec) inspiriert und wird im Rahmen der Werkzeuge [picadata](https://metacpan.org/dist/PICA-Data/view/script/picadata) und Catmandu entwickelt.
Copy link
Member

@nichtich nichtich Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PICA Path is being standardized to unify (at least list a tiny subset of) syntax of several applications (I counted five at least) that all happend to invent their own way to solve a seemingly simple task: reference PICA fields and subfields. PICA Path and pica-rs have already been aligned to prevent xkcd 927 and yet another syntax in the future. Missing steps of the compromise are explained at deutsche-nationalbibliothek/pica-rs#579 (comment).


<example title="Beispiele">
003@
Expand All @@ -21,24 +21,24 @@ Mit **PICA Path** Ausdrücken lassen sich einzelne Felder, Unterfelder und Feldi
Zur vollständigen Unterstützung von PICA Path muss mindestens folgende formale Syntax erkannt werden:

~~~
path ::= ( tag | xtag ) occurrence? subfields?
tag ::= [012.] [0-9.] [0-9.] [A-Z@.]
xtag ::= "2" [0-9.] [0-9.] [A-Z@.] "x" number
occurrence ::= "/" occurenceValue
occurenceValue ::= number "-" number | occurrencePattern | "*"
occurencePattern ::= [0-9] [0-9]? [0-9]?
subfields ::= [$.]? ( [A-Za-z0-9]+ | "*" )
number ::= [0-9]+
path ::= ( tag | xtag ) occurrence? subfields?
tag ::= [012.] [0-9.] [0-9.] [A-Z@.]
xtag ::= "2" [0-9.] [0-9.] [A-Z@.] "x" number
occurrence ::= "/" occurrenceValue
occurrenceValue ::= number "-" number | occurrencePattern | "*"
occurrencePattern ::= [0-9] [0-9]? [0-9]?
subfields ::= [$.]? ( [A-Za-z0-9]+ | "*" )
number ::= [0-9]+
~~~

Als Standard-Erweiterungen sind die Angabe von Positionen in Unterfeldwerten (`position`) und eine alternative Syntax zur Angabe von Occurrences möglich (umgesetzt in den Werkzeugen `picadata` und `Catmandu`):

~~~
path ::= ( tag | xtag ) occurrence? ( subfields position? )?
position ::= "/" ( number | range )
range ::= number "-" number? | "-" number
occurrence ::= "/" occurenceValue | "[" occurrenceValue "]"
occurencePattern ::= [0-9.] [0-9.]? [0-9.]?
path ::= ( tag | xtag ) occurrence? ( subfields position? )?
position ::= "/" ( number | range )
range ::= number "-" number? | "-" number
occurrence ::= "/" occurrenceValue | "[" occurrenceValue "]"
occureencePattern ::= [0-9.] [0-9.]? [0-9.]?
~~~

Positionsangaben beziehen sich nicht auf Bytes sondern auf Unicode-Codepunkte. Bei Positionsangaben über mehrere Unterfelder werden die Unterfeldwerte in Reihenfolge ihres Vorkommens im Feld zu einer Zeichenkette zusammengefügt.
Expand Down