diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index 87b3608e..62b15fd2 100644 --- a/productMods/config/listViewConfig-authorInAuthorship.xml +++ b/productMods/config/listViewConfig-authorInAuthorship.xml @@ -70,9 +70,6 @@ ?editorObj rdfs:label ?editor . } OPTIONAL { ?authorship core:hideFromDisplay ?hideThis } - - FILTER ( bound(?infoResource) ) - } ORDER BY ?subclass DESC(?dateTime) ?infoResourceName diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java index bf75a8be..5252091f 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java @@ -5,6 +5,12 @@ package edu.cornell.mannlib.vitro.webapp.visualization.personpubcount; import java.util.HashSet; import java.util.Set; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.ResourceFactory; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.vocabulary.RDFS; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException; import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer; @@ -63,19 +69,47 @@ public class PersonPublicationCountQueryRunner implements QueryRunner rdfs:label ?authorName .\n" + + " <" + queryURI + "> core:authorOf ?document .\n" + + " ?document core:publicationDate ?publicationDate .\n" + + "}\n" + + "WHERE" + + "{\n" + + " {\n" + + " <" + queryURI + "> rdf:type foaf:Person ;\n" + + " rdfs:label ?authorName ; \n" + + " core:relatedBy ?authorshipNode . \n" + + " ?authorshipNode rdf:type core:Authorship ; \n" + + " core:relates ?document . \n" + + " ?document rdf:type bibo:Document ; \n" + + " rdfs:label ?documentLabel .\n" + + " } UNION {\n" + + " <" + queryURI + "> rdf:type foaf:Person ;\n" + + " core:relatedBy ?authorshipNode . \n" + + " ?authorshipNode rdf:type core:Authorship ;" + + " core:relates ?document . \n" + + " ?document rdf:type bibo:Document . \n" + + " ?document core:dateTimeValue ?dateTimeValue . \n" + + " ?dateTimeValue core:dateTime ?publicationDate .\n" + + " }\n" + + "}\n"; + + log.debug(sparqlQuery); + + return sparqlQuery; + } + private String getSparqlQuery(String queryURI) { String sparqlQuery = QueryConstants.getSparqlPrefixQuery() - + "SELECT ?authorName ?document ?publicationDate\n" + + "SELECT ?document ?publicationDate\n" + "WHERE { \n" - + " <" + queryURI + "> rdf:type foaf:Person ;\n" - + " rdfs:label ?authorName ; \n" - + " core:relatedBy ?authorshipNode . \n" - + " ?authorshipNode rdf:type core:Authorship ;" - + " core:relates ?document . \n" - + " ?document rdf:type bibo:Document . \n" - + " ?document rdfs:label ?documentLabel .\n" - + " OPTIONAL { ?document core:dateTimeValue ?dateTimeValue . OPTIONAL { ?dateTimeValue core:dateTime ?publicationDate } } .\n" + + " <" + queryURI + "> core:authorOf ?document . \n" + + " OPTIONAL { ?document core:publicationDate ?publicationDate . } .\n" + "}\n"; log.debug(sparqlQuery); @@ -106,18 +140,28 @@ public class PersonPublicationCountQueryRunner implements QueryRunner authorDocuments = new HashSet(); - String authorName = null; @Override protected void processQuerySolution(QuerySolution qs) { @@ -128,22 +172,11 @@ public class PersonPublicationCountQueryRunner implements QueryRunner getAuthorDocuments() { return authorDocuments; } - - public String getAuthorName() { - return authorName; - } } }