Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
6a45404
Merge remote-tracking branch 'upstream/develop' into develop
Nov 4, 2020
770680e
Merge remote-tracking branch 'upstream/develop' into develop
Dec 10, 2020
a38f0df
cvm-sp
ekoi Dec 11, 2020
c48df18
cvm-sp temp
ekoi Dec 11, 2020
2868228
cvm-sp temp
ekoi Dec 11, 2020
a55a378
cvm-sp temp
ekoi Dec 11, 2020
db89d30
tmp
ekoi Dec 12, 2020
de12144
tmp
ekoi Dec 12, 2020
74dd56d
tmp
ekoi Dec 12, 2020
53f25b5
Merge remote-tracking branch 'upstream/develop' into develop
Dec 15, 2020
673eef0
uses external js
ekoi Dec 16, 2020
6bc0f17
adding signposting configuration setting
ekoi Jan 12, 2021
879f236
Merge remote-tracking branch 'upstream/develop' into develop
Jan 13, 2021
18ba37c
Merge remote-tracking branch 'upstream/develop' into develop
Jan 14, 2021
3950734
signposting poc from eko
Jan 15, 2021
5abe639
error fix
Jan 15, 2021
3d644d1
move the signposting location in code
Jan 15, 2021
65d69fe
Signposting with MicroSettings cleanup v1
Jan 18, 2021
7345f66
Signposting with MicroSettings cleanup v1 xhtml revert to vanilla
Jan 18, 2021
33fcb95
clean up
Jan 20, 2021
a2e5b64
bug fix and add default file type; TODO: Bug on the baseurl (empty st…
Jan 25, 2021
ddb8780
hide type when do not use default
Jan 25, 2021
f2fb557
set default when no config is set for signposting
Jan 27, 2021
9de4c35
Merge branch 'signposting' of github.com:DANS-KNAW/dataverse into sig…
janvanmansum Jan 28, 2021
1c6fde5
modification according to reviews
Jan 28, 2021
9752c6a
move long json string from code to bunddle
Jan 28, 2021
1c0cbbc
allow empty config on the level 2 profile
Jan 28, 2021
0c40649
Merge branch 'develop' into signposting
janvanmansum Feb 2, 2021
c6d3df2
DD-174 Signposting (#42)
vicding-mi Feb 2, 2021
b441c65
revision based on Herbert feedback
Feb 3, 2021
690c450
coding style cleanup SignpostingResources
Feb 3, 2021
200429a
remove leading comma
Feb 4, 2021
ae21398
fix capitalize with header name
Feb 4, 2021
1211ec2
solve conficts
Feb 12, 2021
2e6deae
DD-174 Signposting (#46)
vicding-mi Feb 18, 2021
65d1ac0
Merge remote-tracking branch 'upstream/develop' into signposting
Feb 19, 2021
545adb0
add items to header when less than maxItems, default license to cc0
Mar 17, 2021
5106574
add items to l1 profile and set default license to cc0
Mar 18, 2021
edf7cc8
use actual file type on l1 profile for items
Mar 18, 2021
d741c14
limit maxAuthors
Mar 19, 2021
17d6450
Merge remote-tracking branch 'upstream/develop' into signposting
Mar 19, 2021
1c25c23
Merge branch 'develop' into signposting
PaulBoon Mar 19, 2021
7e20eae
Merge pull request #58 from PaulBoon/signposting
PaulBoon Mar 19, 2021
891670b
solve conflicts
Mar 19, 2021
ffe7b61
Add Dataset type to landing page, both profile and linkset
Apr 8, 2021
27b2f4e
use configed type instead of string
Apr 12, 2021
0c11ff2
Merge back develop in signposting (#69)
janvanmansum Apr 14, 2021
314f7d1
fix missing author error, note: identity URL is empty sometimes
Apr 19, 2021
ce7f943
create function to get author URL
Apr 19, 2021
e06d9a9
remove num author limit in json
Apr 19, 2021
3f52adc
merged back develop
janvanmansum Apr 23, 2021
300c1e7
revision list 20210511
May 12, 2021
313dae9
Signposting (#59)
vicding-mi May 28, 2021
5ec179a
Resolved conflicts
janvanmansum May 28, 2021
8a53bb6
merging conflicts
May 31, 2021
8c92245
solving conflicts from dans dev
May 31, 2021
15e7f28
Signposting to DANS:signposting branch (#77)
vicding-mi Jun 3, 2021
bb82e32
merge develop from iqss
Jun 9, 2021
1411af0
Merge branch 'signposting' into signposting
janvanmansum Jun 9, 2021
190a0f9
Merge pull request #84 from vicding-mi/signposting
janvanmansum Jun 9, 2021
bd07cb7
Merge remote-tracking branch 'blessed/signposting' into signposting
janvanmansum Jun 9, 2021
5011558
Removed duplicate method
janvanmansum Jun 9, 2021
a656610
Trigger build, to see if Travis succeeds
janvanmansum Jun 9, 2021
ce893a4
Remove unused function
janvanmansum Jun 10, 2021
724e6e4
add release note and skip license link in case of None
Jul 1, 2021
0fab268
add signposting
vicding-mi Feb 15, 2022
3d40896
add release note
vicding-mi Feb 15, 2022
ce8de80
remove code style change from pom
vicding-mi Feb 15, 2022
c91f28f
remove code style change
vicding-mi Feb 15, 2022
a42eba3
Update doc/release-notes/8424-signposting.md
vicding-mi Feb 21, 2022
2b7022a
Update doc/release-notes/8424-signposting.md
vicding-mi Feb 21, 2022
7d25b86
remove license from config and code
vicding-mi Feb 21, 2022
190cb73
do not show signposting in draft state
vicding-mi Feb 22, 2022
1f12893
better naming for function getAuthors to getAuthorsIdSchema
vicding-mi Feb 22, 2022
41abfab
better naming for function getAuthors
vicding-mi Feb 22, 2022
61d14ff
use license utility
vicding-mi Feb 22, 2022
5fe6a8a
remove redundant check
vicding-mi Feb 22, 2022
149e45a
remove pid type from config, use globalid instead; remove null author…
vicding-mi Mar 27, 2022
4a65b4a
remove describedby from release doc
vicding-mi Mar 27, 2022
a538289
use recommended call to get pid uri
vicding-mi Mar 27, 2022
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
32 changes: 32 additions & 0 deletions doc/release-notes/8424-signposting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Signposting for Dataverse

This branch adds [Signposting](https://signposting.org/) support to Dataverse

There are 2 Signposting profile levels, level 1 and level 2. In this implementation,
* level 1 links are shown in
HTTP header, which can be fetched by `curl -I https://domain/link-to-article`.
Copy link
Member

Choose a reason for hiding this comment

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

Would link-to-dataset make more sense than link-to-article?

* The level 2 linkset can be fetched by visiting the dedicated linkset page for
that artifact. The link can be seen in level 1 links with key name `rel="linkset"`.
Copy link
Member

Choose a reason for hiding this comment

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

The term "artifact" might be confusing here. Are we talking about a dataset?


The configuration is stored as JSON string in the `Bundle.properties` file, key name is
Copy link
Member

Choose a reason for hiding this comment

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

Why is the config in Bundle.properties? I see elsewhere that @qqmyers has suggested a database setting called :Signposting, which sounds like a better approach to me.

Copy link
Member

Choose a reason for hiding this comment

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

Why is the config in Bundle.properties? I see elsewhere that @qqmyers has suggested a database setting called :Signposting, which sounds like a better approach to me.

`signposting.configuration.SignpostingConf`. Please see a sample configuration below with explaination for each of the
config items.

```json
{
"useDefaultFileType": true,
"defaultFileTypeValue": "https://schema.org/Dataset",
Copy link
Member

Choose a reason for hiding this comment

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

and again - are there options one might want to choose that are compatible with Signposting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

starting with userDefaultFileType, these are all Signposting specific configuration.
Signposting can show different FileType according to the given metadata, however, in dataverse these metadata is not there yet. I left this to be configurable. If true, the type will be the set type, else it will be the actual type given in metadata.

"maxItems": 5,
"maxAuthors": 5
}
Copy link
Member

Choose a reason for hiding this comment

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

A related question - is there a reason to not enable signposting? Right now with the entry in Bundle.properties, this feature is always on unless one were to edit that. My sense is that this is not really something people will object to, e.g. we don't make the schema.org info in the pages optional, so if we do end up removing the options based on the questions above, I'm not sure we'd be left with a Bundle or Setting for this.

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 signposting cannot be disabled :D

The parameters can be set to the preference of the users. We wanted to make it slightly customizable as in the first draft these are not changeable and the level 1 header becomes really messy and difficult to read, even though it is not particularly set for human to read. ;)

For example, for now Herbert is ok with a default file type set to https://schema.org/Dataset. This might change when there is an upstream schema change or he changes his idea.
maxItems determines max items/files to show in Level 1 profile, as it can get really lengthy. Same goes for maxAuthor.

Copy link
Member

Choose a reason for hiding this comment

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

With the :Signposting setting you're giving people a very easy way to change all of these parameters (or to put '{}' as the value - not sure if that just turns off signposting or breaks the dataset page).

In general, I'm OK with leaving in any parameters you think are needed. My concern is really that by exposing these here you're not just making it possible for Herbert to change them but everyone else as well. If I as a Dataverse installation admin change the type from application/vnd.citationstyles.csl+json or use a different filetypevalue than schema.org/Dataset, would I still be 'Signposting-compliant'? The ones that make the most sense to me are the maxItems/maxAuthor ones - a local admin might want to show 10 authors which would still be valid. The rest seem more like things that should be constants in the code, or only read from the properties file if there has to be a way to change them without recompiling code.

That might suggest that just having a :Signposting setting that lets you change maxItems/maxAuthors (defaulting to 5 if you can't parse) and doesn't otherwise let you mess-up/disable Signposting overall might be better.

As far as I'm concerned, it's up to you whether this makes sense - I doubt many people will even touch the setting since it works by default anyway.

```

* `useDefaultFileType` and `defaultFileTypeValue` are used in combination to provide extra `Dataset` type to DV
datasets. `AboutPage` is required by `Signposting`, hence always present in the datasets. Whilst a second type
could be configured to better reflect the actual scholarly type of the dataset.
* `maxItems` sets the max number of items/files which will be shown in `level 1` profile. Datasets with
too many files will not show any file link in `level 1` profile. They will be shown in `level 2` linkset only.
* `maxAuthors` Same with `maxItems`, `maxAuthors` sets the max number of authors to be shown in `level 1` profile.
If amount of authors exceeds this value, no link of authors will be shown in `level 1` profile.

Note: Authors without author link will not be counted nor shown in any profile/linkset.
Copy link
Member

Choose a reason for hiding this comment

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

In addition to a release note, it probably makes sense to have this in the guides (the whole idea that Dataverse supports Signposting level 1 and 2 and some info about what is included or not included (like authors without a URI). I'm not sure where the best place - @pdurbin might be able to suggest (is there a FAIR section already? I see dataverse.org/software-features points to a presentation on FAIR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, please let me know the ideal location, I can add some docs accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

Hopefully @pdurbin has a suggestion as to where in the guides would be best.

One thing I'll note about the above is that it seems to mix things I can change (e.g. maxAuthors) with info about signposting and fields like AboutPage that I can't change. It might be worthwhile to just give an example level 1 header and then just talk about the parts you might want to change, or at least indicate what is changeable when you list fields.

Copy link
Member

Choose a reason for hiding this comment

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

There's no FAIR section but I just created vicding-mi#1 to suggest creating a "Discoverability" page in the Admin Guide. @vicding-mi if you like this, please feel free to merge it and add more docs. Thanks.

12 changes: 12 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
import edu.harvard.iq.dataverse.search.SearchServiceBean;
import edu.harvard.iq.dataverse.search.SearchUtil;
import edu.harvard.iq.dataverse.search.SolrClientService;
import edu.harvard.iq.dataverse.util.SignpostingResources;
import java.util.Comparator;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
Expand Down Expand Up @@ -5872,4 +5873,15 @@ public boolean downloadingRestrictedFiles() {
}
return false;
}

/**
* Add Signposting
* @return String
*/
public String getSignpostingLinkHeader() {
if (!workingVersion.isReleased())
return null;
SignpostingResources sr = new SignpostingResources(systemConfig, workingVersion, settingsService.getValueForKey(SettingsServiceBean.Key.SignpostingConf));
return sr.getLinks();
}
}
13 changes: 13 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/api/AbstractApiBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,19 @@ protected static Response error( Status sts, String msg ) {
.add( "message", msg ).build()
).type(MediaType.APPLICATION_JSON_TYPE).build();
}

/**
* Adding Signposting
*
* @param bld
* @return HTTP OK response which contains the json structure of linkset
*/
protected Response okLinkset( JsonArrayBuilder bld ) {
Copy link
Member

Choose a reason for hiding this comment

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

A ~style question - is there ever used (now or in the future) except for the Datasets linkset endpoint? If not, would it be simpler to just send an ok(entity, MediaType) from there?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I agree. Instead of a proliferation of "ok" methods like okLinkset, it would be better to delete it from this PR and use ok( JsonObjectBuilder bld ) method like this:

old:

return okLinkset(JsonPrinter.jsonLinkset(new SignpostingResources(systemConfig, dsv, signpostingConf)));

new:

return ok(Json.createObjectBuilder().add("linkset", JsonPrinter.jsonLinkset(new SignpostingResources(systemConfig, dsv, signpostingConf))));

return Response.ok( Json.createObjectBuilder()
.add("linkset", bld).build() )
.type(MediaType.APPLICATION_JSON)
.build();
}
}

class LazyRef<T> {
Expand Down
28 changes: 27 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
import edu.harvard.iq.dataverse.util.json.JSONLDUtil;
import edu.harvard.iq.dataverse.util.json.JsonLDTerm;
import edu.harvard.iq.dataverse.util.json.JsonParseException;
import edu.harvard.iq.dataverse.util.json.JsonPrinter;
import edu.harvard.iq.dataverse.util.SignpostingResources;
import edu.harvard.iq.dataverse.search.IndexServiceBean;
import static edu.harvard.iq.dataverse.util.json.JsonPrinter.*;
import static edu.harvard.iq.dataverse.util.json.NullSafeJsonBuilder.jsonObjectBuilder;
Expand Down Expand Up @@ -530,7 +532,31 @@ public Response getVersionMetadataBlock( @PathParam("id") String datasetId,
return notFound("metadata block named " + blockName + " not found");
});
}


/**
* Add Signposting
* @param datasetId
* @param versionId
* @param uriInfo
* @param headers
* @return
*/
@GET
@Path("{id}/versions/{versionId}/linkset")
public Response getLinkset( @PathParam("id") String datasetId, @PathParam("versionId") String versionId, @Context UriInfo uriInfo, @Context HttpHeaders headers) {
if ( ":draft".equals(versionId) ) {
return badRequest("The :draft version can be viewed");
}
return response( req -> {
DatasetVersion dsv = getDatasetVersionOrDie(req, versionId, findDatasetOrDie(datasetId), uriInfo, headers);
String dataverseSiteUrl = systemConfig.getDataverseSiteUrl();
String anchor = dataverseSiteUrl + "/dataset.xhtml?persistentId=" + dsv.getDataset().getPersistentURL();
String signpostingConf = settingsService.getValueForKey(SettingsServiceBean.Key.SignpostingConf, BundleUtil.getStringFromBundle("signposting.configuration.SignpostingConf"));
if (signpostingConf.isEmpty()) return notFound("Configuration key for signposting is empty [SignpostingConf]");
if (dsv.getId() == null) return notFound("Dataset not found: Id is empty");
return okLinkset(JsonPrinter.jsonLinkset(new SignpostingResources(systemConfig, dsv, signpostingConf)));
Copy link
Member

Choose a reason for hiding this comment

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

Similar question to above - if the end goal is a linkset object containing an array, why not have JsonPrinter create that? Are there current/future use cases where this separation helps?

});
}
@GET
@Path("{id}/modifyRegistration")
public Response updateDatasetTargetURL(@PathParam("id") String id ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ public enum Key {
*/
MetricsUrl,

/**
* Key for Setting of Signposting
*/
SignpostingConf,

/**
* Number of minutes before a metrics query can be rerun. Otherwise a cached value is returned.
* Previous month dates always return cache. Only applies to new internal caching system (not miniverse).
Expand Down
Loading