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

VCards in entry forms, list views, search indexing and visualization #4015

Merged
merged 28 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
993caa4
squashed addEsternal Authors, Editros and ProjectHasExternalParticipa…
litvinovg Nov 22, 2022
50df4a1
Allow VCards to be visualised in co-author graph
bkampe Apr 28, 2022
bbf1906
Add VCard indexer extension for VCards in Authorships/Editorships
grahamtriggs Dec 16, 2018
d3483ef
ExternalEditorsOrgsToInformationResourceGenerator
litvinovg Nov 24, 2022
3773372
combined vcard/person types in AddAuthorsToInformationResourceGenerator
litvinovg Oct 4, 2024
6884f51
Editors VCards
litvinovg Oct 4, 2024
5bd02f4
Fixed authors entry form
litvinovg Oct 4, 2024
0f21dab
fixed editors list view
litvinovg Oct 4, 2024
1754812
Project participant optional VCard
litvinovg Oct 4, 2024
75164a0
Editors entry form: organizations as editors
litvinovg Oct 7, 2024
73ecf5e
Changed list view for presentation participants to support VCards
litvinovg Oct 7, 2024
cdfd672
translations for include external co-authors checkbox
litvinovg Oct 7, 2024
c831df0
fixes for list view and project participant entry form
litvinovg Oct 7, 2024
01ff2b7
fixed checkstyle violations
litvinovg Oct 7, 2024
c503275
fixed list view
litvinovg Oct 10, 2024
9ed7ee1
fixed display of existing person/vcard on project has participant form
litvinovg Oct 10, 2024
74f6fe6
Modified entry form field description text for person type selection …
litvinovg Oct 11, 2024
41f4d25
updated translation
litvinovg Oct 11, 2024
571c7c8
created new settings to control maximum collaborators in co-author ne…
litvinovg Oct 14, 2024
185133a
fixed typo
litvinovg Oct 14, 2024
bc28f63
identation fixes and reverted changed documentation link in list view
litvinovg Nov 4, 2024
ce5c3c6
Fixes for review
litvinovg Dec 17, 2024
3ed8080
refactored VCardsAcrossContextNodes
litvinovg Jan 7, 2025
8463bcb
added newlines to translation files
litvinovg Jan 7, 2025
1f65a99
removed spaces
litvinovg Jan 7, 2025
f4ed985
Converted methods into constants, adjusted access modifiers
litvinovg Jan 7, 2025
20f7d67
Updated entry form texts
litvinovg Jan 7, 2025
5b2e140
removed spaces at the end of lines in example.runtime.properties
litvinovg Jan 17, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ public String getN3PrefixString() {
"@prefix foaf: <" + foaf + "> . \n" ;
}

public String getVcardFailPattern() {
return "@prefix fail_pattern: ?createVCard .\n";
}

public String getPersonInstanceFailPattern() {
return "@prefix fail_pattern: ?createPersonInstance .\n";
}

private String getN3NewAuthorship() {
return getN3PrefixString() +
"?authorshipUri a core:Authorship ;\n" +
Expand All @@ -129,6 +137,12 @@ public List<String> generateN3Optional() {
getN3NewPersonMiddleName(),
getN3NewPersonLastName(),
getN3NewPerson(),

getN3NewPersonVCardFirstName() ,
getN3NewPersonVCardMiddleName(),
getN3NewPersonVCardLastName(),
getN3NewPersonVCard(),

getN3AuthorshipRank(),
getN3ForExistingPerson(),
getN3NewOrg(),
Expand All @@ -138,7 +152,7 @@ public List<String> generateN3Optional() {


private String getN3NewPersonFirstName() {
return getN3PrefixString() +
return getN3PrefixString() + getPersonInstanceFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" +
"?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" +
Expand All @@ -149,7 +163,7 @@ private String getN3NewPersonFirstName() {
}

private String getN3NewPersonMiddleName() {
return getN3PrefixString() +
return getN3PrefixString() + getPersonInstanceFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" +
"?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" +
Expand All @@ -160,7 +174,7 @@ private String getN3NewPersonMiddleName() {
}

private String getN3NewPersonLastName() {
return getN3PrefixString() +
return getN3PrefixString() + getPersonInstanceFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" +
"?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" +
Expand All @@ -171,13 +185,51 @@ private String getN3NewPersonLastName() {
}

private String getN3NewPerson() {
return getN3PrefixString() +
return getN3PrefixString() + getPersonInstanceFailPattern() +
"?newPerson a foaf:Person ;\n" +
"<" + RDFS.label.getURI() + "> ?label .\n" +
"?authorshipUri core:relates ?newPerson .\n" +
"?newPerson core:relatedBy ?authorshipUri . ";
}

// Changes here for creating vcards for external authors
private String getN3NewPersonVCardFirstName() {
return getN3PrefixString() + getVcardFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?vcardPerson a <http://www.w3.org/2006/vcard/ns#Individual> . \n" +
"?vcardPerson vcard:hasName ?vcardName . \n" +
"?vcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" +
"?vcardName vcard:givenName ?firstName .";
}

private String getN3NewPersonVCardMiddleName() {
return getN3PrefixString() + getVcardFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?vcardPerson a vcard:Individual . \n" +
"?vcardPerson vcard:hasName ?vcardName . \n" +
"?vcardName a vcard:Name . \n" +
"?vcardName <http://vivoweb.org/ontology/core#middleName> ?middleName .";
}

private String getN3NewPersonVCardLastName() {
return getN3PrefixString() + getVcardFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?vcardPerson a <http://www.w3.org/2006/vcard/ns#Individual> . \n" +
"?vcardPerson vcard:hasName ?vcardName . \n" +
"?vcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" +
"?vcardName vcard:familyName ?lastName .";
}

// Changes here for creating vcards for external authors
private String getN3NewPersonVCard() {
return getN3PrefixString() + getVcardFailPattern() +
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?vcardPerson a vcard:Individual ;\n" +
"<" + RDFS.label.getURI() + "> ?label .\n" +
"?authorshipUri core:relates ?vcardPerson .\n" +
"?vcardPerson core:relatedBy ?authorshipUri . ";
}

private String getN3ForExistingPerson() {
return getN3PrefixString() +
"?authorshipUri core:relates ?personUri .\n" +
Expand All @@ -197,20 +249,6 @@ private String getN3ForExistingOrg() {
"?authorshipUri core:relates ?orgUri .\n" +
"?orgUri core:relatedBy ?authorshipUri .";
}
/** Get new resources */
//A new authorship uri will always be created when an author is added
//A new person may be added if a person not in the system will be added as author
private Map<String, String> generateNewResources(VitroRequest vreq) {


HashMap<String, String> newResources = new HashMap<String, String>();
newResources.put("authorshipUri", DEFAULT_NS_TOKEN);
newResources.put("newPerson", DEFAULT_NS_TOKEN);
newResources.put("vcardPerson", DEFAULT_NS_TOKEN);
newResources.put("vcardName", DEFAULT_NS_TOKEN);
newResources.put("newOrg", DEFAULT_NS_TOKEN);
return newResources;
}

/** Set URIS and Literals In Scope and on form and supporting methods */
private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) {
Expand All @@ -229,6 +267,9 @@ public void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, Vi
//If an existing person is being used as an author, need to get the person uri
urisOnForm.add("personUri");
urisOnForm.add("orgUri");

urisOnForm.add("createPersonInstance");
urisOnForm.add("createVCard");
editConfiguration.setUrisOnform(urisOnForm);

//for person who is not in system, need to add first name, last name and middle name
Expand All @@ -247,7 +288,6 @@ private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequ
//Sparql queries are all empty for existing values
//This form is different from the others that it gets multiple authors on the same page
//and that information will be queried and stored in the additional form specific data
HashMap<String, String> map = new HashMap<String, String>();
editConfiguration.setSparqlForExistingUris(new HashMap<String, String>());
editConfiguration.setSparqlForExistingLiterals(new HashMap<String, String>());
editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap<String, String>());
Expand All @@ -268,6 +308,7 @@ public void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq
setPersonUriField(editConfiguration);
setOrgUriField(editConfiguration);
setOrgNameField(editConfiguration);
setPatternFailFields(editConfiguration);
}

private void setLabelField(EditConfigurationVTwo editConfiguration) {
Expand All @@ -287,6 +328,10 @@ private void setFirstNameField(EditConfigurationVTwo editConfiguration) {
);
}

private void setPatternFailFields(EditConfigurationVTwo editConfiguration) {
editConfiguration.addField(new FieldVTwo().setName("createVCard"));
editConfiguration.addField(new FieldVTwo().setName("createPersonInstance"));
}

private void setMiddleNameField(EditConfigurationVTwo editConfiguration) {
editConfiguration.addField(new FieldVTwo().
Expand Down Expand Up @@ -436,7 +481,7 @@ public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRe
+ " bind ( COALESCE(?firstName, \"\") As ?firstName1) . \n"
+ " bind ( COALESCE(?middleName, \"\") As ?middleName1) . \n"
+ " bind ( COALESCE(?lastName, \"\") As ?lastName1) . \n"
+ " bind (concat(str(?lastName1 + \", \"),str(?middleName1 + \" \"),str(?firstName1)) as ?authorName) . \n"
+ " bind (concat(str(str(?lastName1) + \", \"),str(str(?middleName1) + \" \"),str(?firstName1)) as ?authorName) . \n"
+ "} } ORDER BY ?rank";


Expand Down
Loading
Loading