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

Show weird join field error. #1624

Closed
wants to merge 1 commit into from
Closed

Show weird join field error. #1624

wants to merge 1 commit into from

Conversation

TobiasNx
Copy link
Contributor

@TobiasNx TobiasNx commented Feb 15, 2023

The subfield $a only exists once. But the join_field behaves like there are multiple subfields $a.

do list(path:"$i.a", "var":"$j")
copy_field("$j", "isPartOf[].$last.hasSuperordinate[].$last.label.$append")
end
join_field("isPartOf[].$last.hasSuperordinate[].$last.label", " / ")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The subfield $a only exists once. But the join_field behaves like there are multiple subfields $a.

Copy link
Member

Choose a reason for hiding this comment

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

You're joining the initial value " / " and the subfield value "Studia Judaica" with your separator " / ", so the output " / / Studia Judaica" is correct, isn't it?

To illustrate the individual parts: "(?<initial value> / )(?<separator> / )(?<subfield value>Studia Judaica)"

do list(path:"$i.a", "var":"$j")
copy_field("$j", "isPartOf[].$last.hasSuperordinate[].$last.label.$append")
end
join_field("isPartOf[].$last.hasSuperordinate[].$last.label")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The subfield $a only exists once. But the join_field behaves like there are multiple subfields $a.

@@ -70,7 +70,7 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT001247609#!",
"label" : "Studia Judaica"
"label" : " / / Studia Judaica"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See output here

@@ -70,7 +70,7 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT002156469#!",
"label" : "DIN-Taschenbuch"
"label" : " / / DIN-Taschenbuch"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or here

@fsteeg
Copy link
Member

fsteeg commented Feb 16, 2023

Not sure about the context, but could something like uniq("isPartOf[].$last.hasSuperordinate[].$last.label") before joining help here? Or setting $last instead of $append in copy_field?

@TobiasNx
Copy link
Contributor Author

It might be this problem: metafacture/metafacture-fix#261

@@ -152,13 +156,19 @@ do list(path: "830??", "var": "$i")
copy_field("$i.w", "isPartOf[].$last.hasSuperordinate[].$last.id")
replace_all("isPartOf[].$last.hasSuperordinate[].$last.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
end
copy_field("$i.a", "isPartOf[].$last.hasSuperordinate[].$last.label")
set_array("isPartOf[].$last.hasSuperordinate[].$last.label", " / ")
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentional, setting the array to " / "?

Copy link
Member

Choose a reason for hiding this comment

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

Also, are you intentionally not $appending the label here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that was an dumb error!

do list(path:"$i.a", "var":"$j")
copy_field("$j", "isPartOf[].$last.hasSuperordinate[].$last.label.$append")
end
join_field("isPartOf[].$last.hasSuperordinate[].$last.label", " / ")
Copy link
Member

Choose a reason for hiding this comment

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

You're joining the initial value " / " and the subfield value "Studia Judaica" with your separator " / ", so the output " / / Studia Judaica" is correct, isn't it?

To illustrate the individual parts: "(?<initial value> / )(?<separator> / )(?<subfield value>Studia Judaica)"

@blackwinter blackwinter assigned TobiasNx and unassigned blackwinter Feb 27, 2023
@TobiasNx TobiasNx closed this Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants