VIVO-112 and VIVO-298
This commit is contained in:
parent
c5d0bc21e8
commit
3d527acce9
5 changed files with 139 additions and 81 deletions
|
@ -10,6 +10,7 @@
|
||||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
||||||
|
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||||
|
|
||||||
SELECT DISTINCT ?subclass
|
SELECT DISTINCT ?subclass
|
||||||
?authorship
|
?authorship
|
||||||
|
@ -41,7 +42,8 @@
|
||||||
OPTIONAL { ?infoResource core:publisher ?publisherObj .
|
OPTIONAL { ?infoResource core:publisher ?publisherObj .
|
||||||
?publisherObj rdfs:label ?publisher
|
?publisherObj rdfs:label ?publisher
|
||||||
}
|
}
|
||||||
OPTIONAL { ?infoResource core:editor ?editorObj .
|
OPTIONAL { ?infoResource core:relatedBy ?editorship .
|
||||||
|
?editorObj core:relatedBy ?editorship .
|
||||||
?editorObj rdfs:label ?editor
|
?editorObj rdfs:label ?editor
|
||||||
}
|
}
|
||||||
OPTIONAL { ?infoResource core:partOf ?partOfObj .
|
OPTIONAL { ?infoResource core:partOf ?partOfObj .
|
||||||
|
@ -118,6 +120,7 @@
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||||
|
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||||
CONSTRUCT {
|
CONSTRUCT {
|
||||||
?subject ?property ?authorship .
|
?subject ?property ?authorship .
|
||||||
?authorship ?authorshipProperty ?authorshipValue .
|
?authorship ?authorshipProperty ?authorshipValue .
|
||||||
|
@ -125,7 +128,10 @@
|
||||||
?infoResource ?infoResourceProperty ?infoResourceValue .
|
?infoResource ?infoResourceProperty ?infoResourceValue .
|
||||||
?infoResource bibo:reproducedIn ?appearsInObj .
|
?infoResource bibo:reproducedIn ?appearsInObj .
|
||||||
?infoResource core:publisher ?publisherObj .
|
?infoResource core:publisher ?publisherObj .
|
||||||
?infoResource core:editor ?editorObj .
|
?infoResource core:relatedBy ?editorship .
|
||||||
|
?editorship a core:Editorship .
|
||||||
|
?editorship core:relates ?editorObj .
|
||||||
|
?editorObj a foaf:Person .
|
||||||
?infoResource core:partOf ?partOfObj .
|
?infoResource core:partOf ?partOfObj .
|
||||||
?appearsInObj rdfs:label ?appearsIn .
|
?appearsInObj rdfs:label ?appearsIn .
|
||||||
?publisherObj rdfs:label ?publisher .
|
?publisherObj rdfs:label ?publisher .
|
||||||
|
@ -159,7 +165,8 @@
|
||||||
} UNION {
|
} UNION {
|
||||||
?subject ?property ?authorship .
|
?subject ?property ?authorship .
|
||||||
?authorship core:relates ?infoResource .
|
?authorship core:relates ?infoResource .
|
||||||
?infoResource core:editor ?editorObj .
|
?infoResource core:relatedBy ?editorship .
|
||||||
|
?editorship core:relates ?editorObj .
|
||||||
?editorObj rdfs:label ?editor
|
?editorObj rdfs:label ?editor
|
||||||
} UNION {
|
} UNION {
|
||||||
?subject ?property ?authorship .
|
?subject ?property ?authorship .
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
WHERE {
|
WHERE {
|
||||||
?subject ?property ?authorship .
|
?subject ?property ?authorship .
|
||||||
?authorship a core:Authorship
|
?authorship a core:Authorship
|
||||||
OPTIONAL { ?authorship core:authorRank ?rank }
|
OPTIONAL { ?authorship core:rank ?rank }
|
||||||
OPTIONAL { ?authorship core:relates ?person .
|
OPTIONAL { ?authorship core:relates ?person .
|
||||||
?person a foaf:Person .
|
?person a foaf:Person .
|
||||||
?person rdfs:label ?personName
|
?person rdfs:label ?personName
|
||||||
|
|
|
@ -8,12 +8,16 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.query.QuerySolution;
|
||||||
|
import com.hp.hpl.jena.query.ResultSet;
|
||||||
|
import com.hp.hpl.jena.rdf.model.RDFNode;
|
||||||
import com.hp.hpl.jena.rdf.model.Literal;
|
import com.hp.hpl.jena.rdf.model.Literal;
|
||||||
import com.hp.hpl.jena.vocabulary.RDFS;
|
import com.hp.hpl.jena.vocabulary.RDFS;
|
||||||
import com.hp.hpl.jena.vocabulary.XSD;
|
import com.hp.hpl.jena.vocabulary.XSD;
|
||||||
|
@ -22,6 +26,7 @@ import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyComparator;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.PublicationHasAuthorValidator;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.PublicationHasAuthorValidator;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeIntervalValidationVTwo;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeIntervalValidationVTwo;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils;
|
||||||
|
@ -334,99 +339,117 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator
|
||||||
public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) {
|
public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) {
|
||||||
HashMap<String, Object> formSpecificData = new HashMap<String, Object>();
|
HashMap<String, Object> formSpecificData = new HashMap<String, Object>();
|
||||||
//Get the existing authorships
|
//Get the existing authorships
|
||||||
formSpecificData.put("existingAuthorInfo", getExistingAuthorships(vreq));
|
formSpecificData.put("existingAuthorInfo", getExistingAuthorships(editConfiguration.getSubjectUri(), vreq));
|
||||||
formSpecificData.put("newRank", getMaxRank(vreq) + 1);
|
formSpecificData.put("newRank", getMaxRank(editConfiguration.getSubjectUri(), vreq) + 1);
|
||||||
formSpecificData.put("rankPredicate", authorRankPredicate);
|
formSpecificData.put("rankPredicate", "http://vivoweb.org/ontology/core#rank");
|
||||||
editConfiguration.setFormSpecificData(formSpecificData);
|
editConfiguration.setFormSpecificData(formSpecificData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<AuthorshipInfo> getExistingAuthorships(VitroRequest vreq) {
|
|
||||||
Individual infoResource = EditConfigurationUtils.getSubjectIndividual(vreq);
|
|
||||||
List<Individual> authorships = infoResource.getRelatedIndividuals(
|
|
||||||
EditConfigurationUtils.getPredicateUri(vreq));
|
|
||||||
//TODO: Check if sorted correctly
|
|
||||||
|
|
||||||
log.debug("authorships = " + authorships);
|
|
||||||
|
|
||||||
sortAuthorshipIndividuals(authorships);
|
|
||||||
|
|
||||||
return getAuthorshipInfo(authorships);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
private static String AUTHORSHIPS_QUERY = ""
|
private static String AUTHORSHIPS_QUERY = ""
|
||||||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
||||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
||||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
|
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
|
||||||
+ "SELECT ?authorshipURI (afn:localname(?authorshipURI) AS ?authorshipName) ?authorURI ?authorName \n"
|
+ "SELECT ?authorshipURI (afn:localname(?authorshipURI) AS ?authorshipName) ?authorURI ?authorName ?rank \n"
|
||||||
+ "WHERE { \n"
|
+ "WHERE { \n"
|
||||||
+ "?subject core:relatedBy ?authorshipURI . \n"
|
+ "?subject core:relatedBy ?authorshipURI . \n"
|
||||||
|
+ "?authorshipURI a core:Authorship . \n"
|
||||||
+ "?authorshipURI core:relates ?authorURI . \n"
|
+ "?authorshipURI core:relates ?authorURI . \n"
|
||||||
+ "?authorURI a foaf:Person . \n"
|
+ "?authorURI a foaf:Person . \n"
|
||||||
+ "?authorURI rdfs:label ?authorName \n"
|
+ "OPTIONAL { ?authorURI rdfs:label ?authorName } \n"
|
||||||
+ "}";
|
+ "OPTIONAL { ?authorshipURI core:rank ?rank } \n"
|
||||||
|
+ "} ORDER BY ?rank";
|
||||||
|
|
||||||
|
|
||||||
private List<Map<String, String>> getExistingAuthorships(String subjectUri, VitroRequest vreq) {
|
private List<AuthorshipInfo> getExistingAuthorships(String subjectUri, VitroRequest vreq) {
|
||||||
|
|
||||||
String queryStr = QueryUtils.subUriForQueryVar(this.getAuthorshipsQuery(), "subject", subjectUri);
|
String queryStr = QueryUtils.subUriForQueryVar(this.getAuthorshipsQuery(), "subject", subjectUri);
|
||||||
log.debug("Query string is: " + queryStr);
|
log.debug("Query string is: " + queryStr);
|
||||||
List<Map<String, String>> authorshipss = new ArrayList<Map<String, String>>();
|
List<Map<String, String>> authorships = new ArrayList<Map<String, String>>();
|
||||||
try {
|
try {
|
||||||
ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
|
ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
|
||||||
while (results.hasNext()) {
|
while (results.hasNext()) {
|
||||||
QuerySolution soln = results.nextSolution();
|
QuerySolution soln = results.nextSolution();
|
||||||
RDFNode node = soln.get("link");
|
RDFNode node = soln.get("authorshipURI");
|
||||||
if (node.isURIResource()) {
|
if (node.isURIResource()) {
|
||||||
webpages.add(QueryUtils.querySolutionToStringValueMap(soln));
|
authorships.add(QueryUtils.querySolutionToStringValueMap(soln));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e, e);
|
log.error(e, e);
|
||||||
}
|
}
|
||||||
log.debug("webpages = " + webpages);
|
log.debug("authorships = " + authorships);
|
||||||
return webpages;
|
return getAuthorshipInfo(authorships);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
private static String MAX_RANK_QUERY = ""
|
||||||
|
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||||
|
+ "SELECT DISTINCT ?rank WHERE { \n"
|
||||||
|
+ " ?subject core:relatedBy ?authorship . \n"
|
||||||
|
+ " ?authorship a core:Authorship . \n"
|
||||||
|
+ " ?authorship core:rank ?rank .\n"
|
||||||
|
+ "} ORDER BY DESC(?rank) LIMIT 1";
|
||||||
|
|
||||||
|
private int getMaxRank(String subjectUri, VitroRequest vreq) {
|
||||||
|
|
||||||
|
int maxRank = 0; // default value
|
||||||
|
String queryStr = QueryUtils.subUriForQueryVar(this.getMaxRankQueryStr(), "subject", subjectUri);
|
||||||
|
log.debug("maxRank query string is: " + queryStr);
|
||||||
|
try {
|
||||||
|
ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
|
||||||
|
if (results != null && results.hasNext()) { // there is at most one result
|
||||||
|
QuerySolution soln = results.next();
|
||||||
|
RDFNode node = soln.get("rank");
|
||||||
|
if (node != null && node.isLiteral()) {
|
||||||
|
// node.asLiteral().getInt() won't return an xsd:string that
|
||||||
|
// can be parsed as an int.
|
||||||
|
int rank = Integer.parseInt(node.asLiteral().getLexicalForm());
|
||||||
|
if (rank > maxRank) {
|
||||||
|
log.debug("setting maxRank to " + rank);
|
||||||
|
maxRank = rank;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.error("Invalid rank returned from query: not an integer value.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e, e);
|
||||||
|
}
|
||||||
|
log.debug("maxRank is: " + maxRank);
|
||||||
|
return maxRank;
|
||||||
|
}
|
||||||
|
|
||||||
private List<AuthorshipInfo> getAuthorshipInfo(
|
private List<AuthorshipInfo> getAuthorshipInfo(
|
||||||
List<Individual> authorships) {
|
List<Map<String, String>> authorships) {
|
||||||
List<AuthorshipInfo> info = new ArrayList<AuthorshipInfo>();
|
List<AuthorshipInfo> info = new ArrayList<AuthorshipInfo>();
|
||||||
for ( Individual authorship : authorships ) {
|
String authorshipUri = "";
|
||||||
String authorshipUri = authorship.getURI();
|
String authorshipName = "";
|
||||||
String authorshipName = authorship.getName();
|
String authorUri = "";
|
||||||
String authorUri = "";
|
String authorName = "";
|
||||||
String authorName = "";
|
|
||||||
Individual author = authorship.getRelatedIndividual(linkedAuthorPredicate);
|
for ( Map<String, String> authorship : authorships ) {
|
||||||
if(author != null) {
|
for (Entry<String, String> entry : authorship.entrySet() ) {
|
||||||
authorUri = author.getURI();
|
if ( entry.getKey().equals("authorshipURI") ) {
|
||||||
authorName = author.getName();
|
authorshipUri = entry.getValue();
|
||||||
}
|
}
|
||||||
AuthorshipInfo aaInfo = new AuthorshipInfo(authorshipUri, authorshipName, authorUri, authorName);
|
else if ( entry.getKey().equals("authorshipName") ) {
|
||||||
info.add(aaInfo);
|
authorshipName = entry.getValue();
|
||||||
|
}
|
||||||
|
else if ( entry.getKey().equals("authorURI") ) {
|
||||||
|
authorUri = entry.getValue();
|
||||||
|
}
|
||||||
|
else if ( entry.getKey().equals("authorName") ) {
|
||||||
|
authorName = entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AuthorshipInfo aaInfo = new AuthorshipInfo(authorshipUri, authorshipName, authorUri, authorName);
|
||||||
|
info.add(aaInfo);
|
||||||
}
|
}
|
||||||
|
log.debug("info = " + info);
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getMaxRank(VitroRequest vreq) {
|
|
||||||
Individual infoResource = EditConfigurationUtils.getSubjectIndividual(vreq);
|
|
||||||
List<Individual> authorships = infoResource.getRelatedIndividuals(
|
|
||||||
EditConfigurationUtils.getPredicateUri(vreq));
|
|
||||||
sortAuthorshipIndividuals(authorships);
|
|
||||||
int maxRank = 0;
|
|
||||||
for(Individual authorship: authorships) {
|
|
||||||
DataPropertyStatement rankStmt = authorship.getDataPropertyStatement(authorRankPredicate);
|
|
||||||
if (rankStmt != null) {
|
|
||||||
maxRank = Integer.parseInt(rankStmt.getData());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return maxRank;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sortAuthorshipIndividuals(List<Individual> authorships) {
|
|
||||||
DataPropertyComparator comp = new DataPropertyComparator(authorRankPredicate);
|
|
||||||
Collections.sort(authorships, comp);
|
|
||||||
}
|
|
||||||
|
|
||||||
//This is the information about authors the form will require
|
//This is the information about authors the form will require
|
||||||
public class AuthorshipInfo {
|
public class AuthorshipInfo {
|
||||||
//This is the authorship node information
|
//This is the authorship node information
|
||||||
|
@ -467,8 +490,12 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator
|
||||||
|
|
||||||
static final String DEFAULT_NS_TOKEN=null; //null forces the default NS
|
static final String DEFAULT_NS_TOKEN=null; //null forces the default NS
|
||||||
|
|
||||||
// protected String getAuthorshipsQuery() {
|
protected String getMaxRankQueryStr() {
|
||||||
// return AUTHORSHIPS_QUERY;
|
return MAX_RANK_QUERY;
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
protected String getAuthorshipsQuery() {
|
||||||
|
return AUTHORSHIPS_QUERY;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,15 +308,24 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement
|
||||||
|
|
||||||
private String getN3ForNewBookNewEditor() {
|
private String getN3ForNewBookNewEditor() {
|
||||||
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
||||||
"?newBook vivo:editor ?newEditor . \n " +
|
"?newBook vivo:relatedBy ?editorship . \n" +
|
||||||
"?newEditor vivo:editorOf ?newBook . \n" +
|
"?editorship vivo:relates ?newBook . \n" +
|
||||||
|
"?newBook <" + label + "> ?book . \n " +
|
||||||
|
"?editorship a vivo:Editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?newEditor . \n" +
|
||||||
|
"?newEditor a <" + editorClass + "> . \n" +
|
||||||
|
"?newEditor vivo:relatedBy ?editorship . \n" +
|
||||||
"?newEditor <" + label + "> ?editor .";
|
"?newEditor <" + label + "> ?editor .";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getN3ForNewBookEditor() {
|
private String getN3ForNewBookEditor() {
|
||||||
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
||||||
"?newBook vivo:editor ?editorUri . \n" +
|
"?newBook vivo:relatedBy ?editorship . \n" +
|
||||||
"?editorUri vivo:editorOf ?newBook . " ;
|
"?editorship vivo:relates ?newBook . \n" +
|
||||||
|
"?newBook <" + label + "> ?book . \n " +
|
||||||
|
"?editorship a vivo:Editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?editorUri . \n" +
|
||||||
|
"?editorUri vivo:relatedBy ?editorship . ";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getN3ForNewBookNewPublisher() {
|
private String getN3ForNewBookNewPublisher() {
|
||||||
|
@ -396,30 +405,44 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement
|
||||||
|
|
||||||
private String getN3ForNewEditor() {
|
private String getN3ForNewEditor() {
|
||||||
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
||||||
"?pubUri vivo:editor ?newEditor . \n" +
|
"?pubUri vivo:relatedBy ?editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?pubUri . \n" +
|
||||||
|
"?editorship a vivo:Editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?newEditor . \n" +
|
||||||
"?newEditor a <" + editorClass + "> . \n" +
|
"?newEditor a <" + editorClass + "> . \n" +
|
||||||
"?newEditor vivo:editorOf ?pubUri . \n" +
|
"?newEditor vivo:relatedBy ?editorship . \n" +
|
||||||
"?newEditor <" + label + "> ?editor .";
|
"?newEditor <" + label + "> ?editor .";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getN3ForEditor() {
|
private String getN3ForEditor() {
|
||||||
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
||||||
"?pubUri vivo:editor ?editorUri . \n" +
|
"?pubUri vivo:relatedBy ?editorship . \n" +
|
||||||
"?editorUri vivo:editorOf ?pubUri . ";
|
"?editorship vivo:relates ?pubUri . \n" +
|
||||||
|
"?editorship a vivo:Editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?editorUri . \n" +
|
||||||
|
"?editorUri vivo:relatedBy ?editorship . ";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getN3ForNewEditorNewPub() {
|
private String getN3ForNewEditorNewPub() {
|
||||||
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
||||||
"?newPublication vivo:editor ?newEditor . \n" +
|
"?newPublication vivo:relatedBy ?editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?newPublication . \n" +
|
||||||
|
"?newPublication <" + label + "> ?title ." +
|
||||||
|
"?editorship a vivo:Editorship . \n" +
|
||||||
|
"?editorship vivo:relates ?newEditor . \n" +
|
||||||
"?newEditor a <" + editorClass + "> . \n" +
|
"?newEditor a <" + editorClass + "> . \n" +
|
||||||
"?newEditor vivo:editorOf ?newPublication . \n" +
|
"?newEditor vivo:relatedBy ?editorship . \n" +
|
||||||
"?newEditor <" + label + "> ?editor .";
|
"?newEditor <" + label + "> ?editor .";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getN3ForEditorNewPub() {
|
private String getN3ForEditorNewPub() {
|
||||||
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
return "@prefix vivo: <" + vivoCore + "> . \n" +
|
||||||
"?newPublication vivo:editor ?editorUri . \n" +
|
"?newPublication vivo:relatedBy ?editorship . \n" +
|
||||||
"?editorUri vivo:editorOf ?newPublication . ";
|
"?editorship vivo:relates ?newPublication . \n" +
|
||||||
|
"?newPublication <" + label + "> ?title ." +
|
||||||
|
"?editorship vivo:relates ?editorUri . \n" +
|
||||||
|
"?editorship a vivo:Editorship . \n" +
|
||||||
|
"?editorUri vivo:relatedBy ?editorship . ";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getN3ForNewPublisher() {
|
private String getN3ForNewPublisher() {
|
||||||
|
@ -525,6 +548,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement
|
||||||
newResources.put("newConference", DEFAULT_NS_TOKEN);
|
newResources.put("newConference", DEFAULT_NS_TOKEN);
|
||||||
newResources.put("newEvent", DEFAULT_NS_TOKEN);
|
newResources.put("newEvent", DEFAULT_NS_TOKEN);
|
||||||
newResources.put("newEditor", DEFAULT_NS_TOKEN);
|
newResources.put("newEditor", DEFAULT_NS_TOKEN);
|
||||||
|
newResources.put("editorship", DEFAULT_NS_TOKEN);
|
||||||
newResources.put("vcardEditor", DEFAULT_NS_TOKEN);
|
newResources.put("vcardEditor", DEFAULT_NS_TOKEN);
|
||||||
newResources.put("vcardName", DEFAULT_NS_TOKEN);
|
newResources.put("vcardName", DEFAULT_NS_TOKEN);
|
||||||
newResources.put("newPublisher", DEFAULT_NS_TOKEN);
|
newResources.put("newPublisher", DEFAULT_NS_TOKEN);
|
||||||
|
|
|
@ -24,8 +24,8 @@ public class ModelUtils {
|
||||||
private static final String processPropertyInverseURI = "http://purl.obolibrary.org/obo/BFO_0000055";
|
private static final String processPropertyInverseURI = "http://purl.obolibrary.org/obo/BFO_0000055";
|
||||||
private static final String nonProcessPropertyURI = "http://vivoweb.org/ontology/core#roleContributesTo";
|
private static final String nonProcessPropertyURI = "http://vivoweb.org/ontology/core#roleContributesTo";
|
||||||
private static final String nonProcessPropertyInverseURI = "http://vivoweb.org/ontology/core#contributingRole";
|
private static final String nonProcessPropertyInverseURI = "http://vivoweb.org/ontology/core#contributingRole";
|
||||||
private static final String grantPropertyURI = "http://vivoweb.org/ontology/core#relates";
|
private static final String grantPropertyURI = "http://vivoweb.org/ontology/core#relatedBy";
|
||||||
private static final String grantPropertyInverseURI = "http://vivoweb.org/ontology/core#relatedBy";
|
private static final String grantPropertyInverseURI = "http://vivoweb.org/ontology/core#relates";
|
||||||
|
|
||||||
private static Set<String> processClass = new HashSet<String>();
|
private static Set<String> processClass = new HashSet<String>();
|
||||||
static {
|
static {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue