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

Add containedIn, add details to bibliographicCitation #101

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 7 additions & 6 deletions app/controllers/nwbib/Lobid.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static WSRequest request(final String q, final String person,

if (requestHolder.getQueryParameters().get("q") == null
&& requestHolder.getQueryParameters().get("word") == null) {
requestHolder.setQueryParameter("word", "*");
requestHolder.setQueryParameter("q", "*");
}
Logger.debug("Request URL {}, query params {} ", requestHolder.getUrl(),
requestHolder.getQueryParameters());
Expand All @@ -147,18 +147,19 @@ static WSRequest request(final String q, final String person,

private static WSRequest setupWordParameter(final String q,
final String rpbspatial, String word, WSRequest requestHolder) {
String searchParam = "q";
if (!q.trim().isEmpty() && rpbspatial.isEmpty())
return requestHolder.setQueryParameter("word", preprocess(q));
return requestHolder.setQueryParameter(searchParam, preprocess(q));
else if (!q.trim().isEmpty() && !rpbspatial.isEmpty())
return requestHolder.setQueryParameter("word",
return requestHolder.setQueryParameter(searchParam,
preprocess(q) + " AND " + setUprpbspatial(rpbspatial));
else if (!word.isEmpty() && rpbspatial.isEmpty())
return requestHolder.setQueryParameter("word", preprocess(word));
return requestHolder.setQueryParameter(searchParam, preprocess(word));
else if (!word.isEmpty() && !rpbspatial.trim().isEmpty()) {
return requestHolder.setQueryParameter("word",
return requestHolder.setQueryParameter(searchParam,
preprocess(word) + " AND " + setUprpbspatial(rpbspatial));
} else if (!rpbspatial.trim().isEmpty())
return requestHolder.setQueryParameter("word",
return requestHolder.setQueryParameter(searchParam,
setUprpbspatial(rpbspatial));
return requestHolder;
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/result_doc.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
@withPrefixedLink("URN", "https://nbn-resolving.org/", doc \ "urn")
@result_field("Umfang", "extent", doc, TableRow.VALUES)
@result_field("Quelle", "bibliographicCitation", doc, TableRow.VALUES)
@result_field("In", "containedIn", doc, TableRow.LINKS)
@labelled("In", "containedIn")

@part_of("isPartOf", "hasSuperordinate")
@subordinateSearchFor(String.format("http://lobid.org/resources/%s#!", (doc \ "hbzId").asOpt[String].getOrElse("")))
Expand Down
21 changes: 19 additions & 2 deletions conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,24 @@ set_array("contribution[]")
call_macro("contributions", from: "person")
call_macro("contributions", from: "corporateBody")

move_field("bibliographicCitation[].*.value", "bibliographicCitation")
set_array("containedIn[]")
set_array("bibliographicCitation")

do list_as(citation: "bibliographicCitation[]")
copy_field("citation.value", "fullLabel")
if all_match("citation.value", "^http.*")
copy_field("citation.value", "containedIn[].$append.id")
copy_field("citation.label", "containedIn[].$last.label")
paste("fullLabel", "citation.label", "~ ",
"citation.volume", "~ (", "citation.year", "~) ",
"citation.issue", "~ ", "citation.alternativeNumbering",
"~ Seite ", "citation.pages", join_char: "")
replace_all("fullLabel", "\\(\\)", "") # empty year
end
move_field("fullLabel", "bibliographicCitation.$append")
end

uniq("containedIn[]")
join_field("bibliographicCitation", "; ")

# fulltextOnline and link to external description/ToC
Expand All @@ -345,6 +362,6 @@ end

move_field("edition", "edition[]")

retain( "type[]", "contribution[]", "edition[]", "extent", "hasItem[]", "responsibilityStatement[]", "language[]", "medium[]", "subject[]", "title", "hbzId", "oclcNumber[]", "otherTitleInformation[]", "natureOfContent[]", "publication[]", "sameAs[]", "describedBy", "@context", "id", "zdbId", "spatial[]", "inCollection[]", "rpbId", "schoeneNummer", "bibliographicCitation", "isPartOf[]", "note[]", "fulltextOnline[]", "description[]", "isbn[]")
retain( "type[]", "contribution[]", "edition[]", "extent", "hasItem[]", "responsibilityStatement[]", "language[]", "medium[]", "subject[]", "title", "hbzId", "oclcNumber[]", "otherTitleInformation[]", "natureOfContent[]", "publication[]", "sameAs[]", "describedBy", "@context", "id", "zdbId", "spatial[]", "inCollection[]", "rpbId", "schoeneNummer", "bibliographicCitation", "isPartOf[]", "note[]", "fulltextOnline[]", "description[]", "isbn[]", "containedIn[]")

vacuum()
Loading