Giter Site home page Giter Site logo

glenrobson / simpleannotationserver Goto Github PK

View Code? Open in Web Editor NEW
97.0 17.0 29.0 35.25 MB

A simple IIIF and Mirador compatible Annotation Server

License: Apache License 2.0

Java 9.57% HTML 1.21% JavaScript 77.40% CSS 11.51% Dockerfile 0.08% Shell 0.12% Python 0.11%
iiif annotation-server iiif-search

simpleannotationserver's Introduction

Build Status

SimpleAnnotationServer

This is an Annotation Server which is compatible with IIIF and Mirador. This Annotation Server includes a copy of Mirador so you can get started creating annotations straight away. The annotations are stored as linked data in an Apache Jena triple store by default. It is also possible to store the annotations in SOLR.

Now supports IIIF Search API in both the Universal Viewer and Mirador

For details see IIIF Search

Getting Started

Requires:

To verify you have the correct package installed, you can run the following command from a terminal or command prompt:

$ java -version
# java version "1.11.0_102"

You should see version 1.11.x. :

Step 1: Download

Download the pre-built SimpleAnnotationStore by going to the Releases page:

Download the latest sas.zip which might be hidden under the Assets drop down.

Step 2: Extract Zip file

Extract the zip file, on a Mac double clicking on the file will extract it. On windows make sure the zip file is extracted by right clicking on the zip file and selecting uncompress.

Step 3: Run the SimpleAnnotationServer

Open up a terminal or command prompt and do the following:

cd extracted_sas_directory/sas
java -jar dependency/jetty-runner.jar --port 8888 simpleAnnotationStore.war

Navigate to:

http://localhost:8888/index.html

You should now see Mirador with the default example objects. You can choose any manifest to start annotating

Further guides

SimpleAnnotationServer or SAS aims to fulfil two main use cases; an easy to install and get going annotation server and also a production quality annotation server. The guides below detail different operations you can undertake with SAS. In the next section it discusses how to develop with SAS and looks at some of the more complicated deployment options.

User guides

Local Development

Requires:

  • Java 11 with JDK (Java Development Kit, not just the Runtime)
  • maven

To begin working with Mirador and the Simple Annotation Server do the following:

  • Download code

git clone https://github.com/glenrobson/SimpleAnnotationServer.git

  • Move into the SimpleAnnotationServer directory.

cd SimpleAnnotationServer

  • Start the jetty http server

mvn jetty:run

  • Start Annotating

Navigate to http://localhost:8888/index.html

You should now see Mirador with the default example objects. You can choose any manifest to start annotating.

Docker installs

There are a number of docker files in the docker directory with different backend configurations. For details on the different options see the dev guide but to run the basic SAS instance with a Jena database you can run the following script:

./runDocker.sh Jena

which will use this Dockerfile docker/sas-tomcat/Dockerfile

Developer guides

Roadmap

Note this project doesn't currently contain Authentication although it is possible to secure the SAS web application with a single username and password using Apache forwarding. Plans for future developments include:

  • Add ElasticSearch as a backend.
  • Easy Deployment on AWS with ElasticSearch
  • Web annotations
  • Removing support for Sesame
  • Support for Mirador 3
  • Authentication – Shibboleth, Facebook/Google
  • Annotation versioning

Please add an issue if there are other enhancements which would be useful.

Thanks

Thanks to:

  • azaroth42 for help with JsonLd framing and other useful tips.
  • Illtud and Paul for help with testing and fixing build problems.
  • Dan for introducing me to Apache Jena and SOLR documentation.
  • regisrob for help with the Mirador within code.

and finally thanks to the IIIF and Mirador communities which make all this cool stuff possible.

simpleannotationserver's People

Contributors

aeschylus avatar bencomp avatar dependabot[bot] avatar dodeeric avatar glenrobson avatar hotnuts21 avatar kinow avatar robcast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpleannotationserver's Issues

Automatic storage of enriched manifests

Is there any way to automate the following steps?

  • Enhance the annotated manifests with the JSON snippets specifying the search service and the annotation list

  • Save the enhanced manifests on the web server

Goal: The annotated manifests can be searched for annotations without the user having to copy and paste JSON snippets manually.
Would it be possible, for instance, to make a python script interact with the SAS in order to achieve this goal, similarly to the Batch downlading annotations (https://github.com/glenrobson/SimpleAnnotationServer/blob/master/doc/DownloadAnnotations.md)?

Problem with Sesame 2.7.13

Reported by @regisrob:

"I tried to deploy the webapp on a server using Sesame as the storage solution, but unfortunately it raised another issue (which is not related to SimpleAnnotationServer at first glance): "Problem connecting to Sesame. Unsupported MIME type: application/ld+json"
If it's relevant for you I could post a separate ticket about that in two weeks (I'm out of the office next week)."

originally from #6.

Enable CORS?

Nice work on this! Very simple to get up and running. Have you considered enabling CORS by adding the CORS Filter to the web.xml file? My Mirador instance lives in another app and I would prefer to use the annotation server from another origin.

SimpleAnnotationServer and wildfly

from IIIF list:

I am trying to deploy the server, but when I did it with wildfly, and try to annotate I get org.apache.jena.riot.RiotException: invalid remote context: .....\vfs\temp\temp6f508a3bfaac86cd\content-48a3dfe8e6d53b1c\contexts\iiif-2.0.json . It seems that either the file is really invalid or I am doing something wrong. So I will be very thankful if you tell me how did you deploy it.
Sorry for not answering your question.

Remove support for Sesame

SAS supports too many options which makes development and maintenance more difficult. The original reason to support Sesame was to give a Web front end to access the annotations as linked data. This can now be done with Jena using the Fueski web front end.

Jena is a better solution for an RDF store as it can run locally without a separate Web App so it fits the primary use case of a simple install.

Unless issues are raised here Sesame support will be removed in the near future.

Search cannot support non-latin characters (java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map).

I updated an annotation text from English to Chinese in the Mirador frontend, and checked by accessing http://localhost:8888/annotation/ The Chinese characters are saved in the store! See the screenshot below:
image

But again when I search with the Chinese characters, nothing found and there are warning info in the console.
image
image

URI http://localhost:8888/search-api/3320640/search?q=%E5%90%8E%E6%9D%A5
2020-01-08 14:49:49.262:WARN:oejs.ServletHandler:/search-api/3320640/search
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
        at uk.org.llgc.annotation.store.adapters.AbstractRDFStore.search(AbstractRDFStore.java:221)
        at uk.org.llgc.annotation.store.IIIFSearchAPI.doGet(IIIFSearchAPI.java:77)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1359)
        at uk.org.llgc.annotation.store.filters.CorsFilter.doFilter(CorsFilter.java:24)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1330)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
        at org.eclipse.jetty.server.Server.handle(Server.java:345)
        at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
        at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
        at java.lang.Thread.run(Thread.java:748)

So I tried to re-index the manifest on http://localhost:8888/uploadManifest.html, but 500 error occured:
image

HTTP ERROR 500
Problem accessing /manifests. Reason:

    Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (BufferedReader); line: 1, column: 2]
Caused by:
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (BufferedReader); line: 1, column: 2]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:693)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:591)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1902)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:757)
	at com.github.jsonldjava.utils.JsonUtils.fromJsonParser(JsonUtils.java:191)
	at com.github.jsonldjava.utils.JsonUtils.fromReader(JsonUtils.java:173)
	at com.github.jsonldjava.utils.JsonUtils.fromInputStream(JsonUtils.java:154)
	at com.github.jsonldjava.utils.JsonUtils.fromInputStream(JsonUtils.java:111)
	at uk.org.llgc.annotation.store.AnnotationUtils.frameManifest(AnnotationUtils.java:296)
	at uk.org.llgc.annotation.store.adapters.AbstractRDFStore.getManifest(AbstractRDFStore.java:149)
	at uk.org.llgc.annotation.store.adapters.AbstractStoreAdapter.indexManifest(AbstractStoreAdapter.java:232)
	at uk.org.llgc.annotation.store.adapters.AbstractStoreAdapter.indexManifest(AbstractStoreAdapter.java:226)
	at uk.org.llgc.annotation.store.ManifestUpload.doPost(ManifestUpload.java:69)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1359)
	at uk.org.llgc.annotation.store.filters.CorsFilter.doFilter(CorsFilter.java:24)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1330)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
	at org.eclipse.jetty.server.Server.handle(Server.java:345)
	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
	at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
	at java.lang.Thread.run(Thread.java:748)
Powered by Jetty://

populate does not work like create

I tried using the controller "/populate" (POST). It seemed to work, but when
trying to search on uri ("/annotation/search") it return an empty array.

When I created the annotations directly by posting to "/annotation/create",
it worked. Any idea why?

Snag list

Collection page

  • Add collection doesn’t add the collection straight away
  • Rename inbox to Default collection
  • Renaming collections doesn’t seem to work.
  • Hit the enter key to click OK.

Manifest page

  • Manifest link iiif logo and copy to clipboard
  • Default to last collection you were working on.

Share page

  • Make all enhanced links work over https

Search

  • Case sensitive search

Solr as "sidecar" rather than as primary store?

Wouldn't it be better to use a store like Solr as an extra store, rather than as a primary store?
Solr is good for search, not for backend storage.

Maybe add a "sidecar store" functionality:

  • add annotation to "safe" backend store (rdf store)
  • add annotation to Solr (optional). When configured, the search api also uses this store.

Resources in Annotations in dynamic AnnotationLists have non-unique blank node identifiers

When I perform a IIIF Content Search, the Annotations that are returned all share the same blank node ID _:b2 for the resource.

When I request the list of all annotations the other parts of annotations share blank node IDs _:b0, _:b1, _:b3 and _:b4 for all first targets, choice selector, default selector and alternative selector respectively.

"@type" : "sc:AnnotationList",
  "resources" : [ {
    "@id" : "https://iiif.universiteitleiden.nl/anno//annotation/1538394902757",
    "@type" : "oa:Annotation",
    "dcterms:created" : "2018-10-01T13:55:02",
    "resource" : [ {
      "@id" : "_:b2",
      "@type" : "dctypes:Text",
      "http://dev.llgc.org.uk/sas/full_text" : "Nice!",
      "format" : "text/html",
      "chars" : "<p>Nice!</p>"
    } ],
    "on" : [ {
      "@id" : "_:b0",
      "@type" : "oa:SpecificResource",
      "within" : {
        "@id" : "https://purl.stanford.edu/rd447dz7630/iiif/manifest",
        "@type" : "sc:Manifest"
      },
      "selector" : {
        "@id" : "_:b1",
        "@type" : "oa:Choice",
        "default" : {
          "@id" : "_:b3",
          "@type" : "oa:FragmentSelector",
          "value" : "xywh=2092,2778,1028,850"
        },
        "item" : {
          "@id" : "_:b4",
          "@type" : "oa:SvgSelector",
          "value" : "snip"
        }
      },
      "full" : "https://purl.stanford.edu/rd447dz7630/iiif/canvas/rd447dz7630_10"
    } ],
    "motivation" : [ "oa:commenting" ],
    "@context" : "http://iiif.io/api/presentation/2/context.json"
  }, {
    "@id" : "https://iiif.universiteitleiden.nl/anno/annotation/1539265909096",
    "@type" : "oa:Annotation",
    "dcterms:created" : "2018-10-11T15:51:49",
    "dcterms:modified" : "2018-10-12T16:23:42",
    "resource" : [ {
      "@id" : "_:b2",
      "@type" : "dctypes:Text",
      "http://dev.llgc.org.uk/sas/full_text" : "snip",
      "format" : "text/html",
      "chars" : "snip"
    } ],
    "on" : [ {
      "@id" : "_:b0",
      "@type" : "oa:SpecificResource",
      "within" : {
        "@id" : "https://iiif.universiteitleiden.nl/manifests/external/louvre/e-7852.json",
        "@type" : "sc:Manifest"
      },
      "selector" : {
        "@id" : "_:b1",
        "@type" : "oa:Choice",
        "default" : {
          "@id" : "_:b3",
          "@type" : "oa:FragmentSelector",
          "value" : "xywh=1557,446,627,144"
        },
        "item" : {
          "@id" : "_:b4",
          "@type" : "oa:SvgSelector",
          "value" : "snip"
        }
      },
      "full" : "https://iiif.universiteitleiden.nl/manifests/external/louvre/e-7852/canvas/p1"
    } ],
    "motivation" : [ "oa:commenting" ],
    "@context" : "http://iiif.io/api/presentation/2/context.json"
  },
...

I guess that it doesn't really matter for applications treating annotations as JSON objects, but RDF tools like the OpenLink Structured Data Sniffer see the data in a completely different way.

Can these @ids be made unique in the context of the annotation list/search result?

Performance issues due to jsonblob API calls ?

Hi, we are evaluating Simple Annotation Server as the transcription backend for a digital edition project. In principle it works pretty well for us, however we experience some poor performance caused by Mirador continuously making calls to https://jsonblob.com (seemingly to persist its UI state). Is this anything you have experienced on you side as well? I found some old github discussions reg. this issue (ProjectMirador/mirador#559), and it seems that it should have been solved in recent versions of Mirador – so I was wondering if you considered upgrading Mirador shipped with Simple Annotation Server? (or is there a show stopper of any kind?)
Apart of this: Thank you for your work on this, it seems really promising!

Annotations not saved in mirador 2.1.4 or 2.1.1 or 2.20

If I draw an annotation on an image and save it, it disappears. Either immediately, on 2.1.1, or once I close the annotation icons or refresh on 2.1.4. It works with the 2.0.0 version the annotation server release (up to date as of November 2016) came with. I've tried it both with the mirador release copied to webapp/mirador, and with it referencing it from a different location.

Error:
POST http://iiif.bodleian.ox.ac.uk/annotation-server/annotation/create?APIKey=undefined 500 (java.util.ArrayList cannot be cast to java.lang.String)
(anonymous) @ VM156:2
send @ jquery.min.js:4
ajax @ jquery.min.js:4
a.ajax @ jquery-migrate-3.0.0.min.js:2
create @ simpleASEndpoint.js:163
(anonymous) @ window.js:389
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
trigger @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
each @ jquery.min.js:2
each @ jquery.min.js:2
trigger @ jquery.min.js:4
n.publish @ pubsub.min.js:4
$.EventEmitter.(anonymous function) @ eventemitter.js:31
(anonymous) @ osd-svg-overlay.js:359
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
trigger @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
each @ jquery.min.js:2
each @ jquery.min.js:2
trigger @ jquery.min.js:4
n.publish @ pubsub.min.js:4
$.EventEmitter.(anonymous function) @ eventemitter.js:31
onAnnotationCreated @ osd-svg-overlay.js:1058
(anonymous) @ annotationTooltip.js:97
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
window.js:399 There was an error saving this new annotation

Problem showing 12 or more tagged annotations in Mirador

I'm not sure if this is a concern with Simple Annotation Server or Mirador, but I thought I would start here.

I have Simple Annotation Server (mirador 2.1.4 branch) working well with Mirador 2.6.1, at least for the first few annotations.
The problem is that after 12 or more tagged annotations on the same canvas are stored in Simple Annotation Server they all disappear in the next browser session.
By next browser session, I mean it appears to keep working but if I close the browser and start again, the annotations do not appear in Mirador.
The annotations are still there in SimpleAnnotationServer (they appear in the JSON returned from :8888/annotation/).

The simplest recreation of the problem involved going to a canvas and adding 13 annotations.
At that point it still worked, even in a new browser session.
Then I added tags to all 13 annotations, and they did not appear in the next browser session.

The short-term solution has been to move annotations from Simple Annotation Server to static json files (no data was lost).

My annotation server is at http://35.162.52.109:8888/annotation/
The Mirador instance is at http://jubilees.stmarytx.edu/mirador/
The test page is the third canvas on "Jubilees Palimpsest Project, Milan 2017" (not sure of the best way to link directly until I borrow the javascript from Durham)

Show annotations created

You can see the annotations as they are created in the Jetty terminal as JSON-LD and if deployed in tomcat they should be in the catalina.out but apart from that there is no way to see them. It would be good to a have a list.html which lets you see all the pages that have annotations and then click the links to take you to the search servlet.

Also be nice if you could get them in RDF XML as well as JSON.

Support Eleastic search as a SAS backend

To aid deployment to AWS we are planning to add Elastic search as a backend. This should allow the automated deployment of the SAS code without overwritting the annotation data. The AWS elastic search details are here:

https://aws.amazon.com/elasticsearch-service/

To do check list:

  • Setup docker-compose instance with Elastic Search and SAS
  • Clean up adapter interface (look at splitting Manifest, Annotation into separate classes)
  • Implement Elastic Search adapter
  • Add ElasticSearch integration tests
  • Look at AWS ElasticSearch and deployment implications
  • Implement auto deployment to AWS

Simple Annotation server Docker charachter encoding problem

I’m installing the SAS docker annotation service
I have already successfully inserted the attached json file in a solr cloud service.

But there is a problem with special characters like ë or é as you can see in the resulting search api url below:

"startIndex" : 0,
"within" : {
"total" : "96",
"@type" : "sc:Layer"
},
"@type" : "sc:AnnotationList",
"resources" : [ {
"@type" : "oa:Annotation",
"motivation" : "sc:painting",
"resource" : {
"@type" : "dctypes:Text",
"format" : "text/html",
"chars" : "

van voorbeeld zouden leeren, waer me Wyd�br

",
"http://dev.llgc.org.uk/sas/full_text" : "van voorbeeld zouden leeren, waer me Wyd�br"
},
"on" : "https://services.libis.be/m2/IE5032134/canvas/canvas-FL5033285.json#xywh=241,1781,1954,110",
"@id" : "http://localhost:8080/sas/annotationcd07fe8223745d33d2d5dcbd72b358d6/16",
"@context" : "http://iiif.io/api/presentation/2/context.json",
"http://purl.org/dc/terms/created" : "2020-05-26T12:10:15",
"http://purl.org/dc/terms/modified" : "2020-05-26T12:10:24",
"label" : "van voorbeeld zouden leeren, waer me Wyd�br"
}, {
….

Do you know where I have to adapt the character setting?

I’ m also wondering if you can create dynamic annotations in the mirador viewer with the created annotation service , in my case
http://localhost:9002/sas/search-api/IE5032134/search

Thanks in advance,

Best regards,

Stephan Pauls

canvas-FL5033285.TXT

Delete Annotation

Mirador is not successfully deleting annotations. I might consider this a feature, but I do need some way to delete annotations. Is there a curl-based approach to this? Something like this?
curl -v -iX "DELETE" -H 'If-Match: "1527260370078"' http://35.155.241.146:8888/simpleAnnotationStore/annotation/

Sharing/downloading annotated manifests

We have a use case with the new auth SAS:

A lecturer asks a student to annotate a particular document/manifest and then once complete the student would send to the lecturer a URL of the annotated manifest or a URL for mirador loaded with the annotated manifest.

Currently with the new auth SAS, a student could be provided with a URL directly to the manifest that requires annotating: http://dev.gdmrdigital.com/view.xhtml?manifest=https://purl.stanford.edu/rd447dz7630/iiif/manifest .

However there's no way for the student to share a "completed" manifest with annotations either embedded within the manifest or added via otherContent without them manually doing some editing work. I'd envisage a "share annotated manifest" button and maybe a "share annotated manifest in mirador" button that would somehow generate an annotated manifest and present it for viewing, or open mirador for viewing it (which the URL can then be shared).

The urls for the generated annotated manifests or the otherContent url would have to be GUIDified so they aren't easily accessible/guessable if they are to be shared.

It would be nice to be able to share a collection-level manifest which would contain a group of annotated manifests a student has been working on, but that's super-difficult i think!

Test error: invalid remote context

I think this is different from #9 and possibly related to the move of making all of iiif.io available via HTTPS by default.

When I run mvn package, two tests error with a Jena RiotException:

...
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ simpleAnnotationStore ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running uk.org.llgc.annotation.store.test.TestBOR
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.095 sec - in uk.org.llgc.annotation.store.test.TestBOR
Running uk.org.llgc.annotation.store.test.TestMirador2
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.327 sec - in uk.org.llgc.annotation.store.test.TestMirador2
Running uk.org.llgc.annotation.store.test.TestMirador214
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.228 sec - in uk.org.llgc.annotation.store.test.TestMirador214
Running uk.org.llgc.annotation.store.test.TestPublish
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.021 sec - in uk.org.llgc.annotation.store.test.TestPublish
Running uk.org.llgc.annotation.store.test.TestSearch
16:47:17,514 ERROR [org.apache.jena.riot] invalid remote context: http://iiif.io/api/presentation/2/context.json
Test testEndToEnd(uk.org.llgc.annotation.store.test.TestSearch) failed. Jena data is aviliable in: /var/folders/mw/cyflttp13qb25jvyqqhn74qwljlstg/T/27-47-2018_16-47-05-614/data
16:47:18,387 ERROR [org.apache.jena.riot] invalid remote context: http://iiif.io/api/presentation/2/context.json
Test loadManifest(uk.org.llgc.annotation.store.test.TestSearch) failed. Jena data is aviliable in: /var/folders/mw/cyflttp13qb25jvyqqhn74qwljlstg/T/27-47-2018_16-47-18-330/data
short: 6cffa0b6558ab0f3e40d61f5ab3be1bf
Tests run: 8, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 13.344 sec <<< FAILURE! - in uk.org.llgc.annotation.store.test.TestSearch
testEndToEnd(uk.org.llgc.annotation.store.test.TestSearch)  Time elapsed: 11.91 sec  <<< ERROR!
org.apache.jena.riot.RiotException: invalid remote context: http://iiif.io/api/presentation/2/context.json
	at uk.org.llgc.annotation.store.test.TestSearch.testEndToEnd(TestSearch.java:273)

loadManifest(uk.org.llgc.annotation.store.test.TestSearch)  Time elapsed: 0.063 sec  <<< ERROR!
org.apache.jena.riot.RiotException: invalid remote context: http://iiif.io/api/presentation/2/context.json
	at uk.org.llgc.annotation.store.test.TestSearch.loadManifest(TestSearch.java:124)

Running uk.org.llgc.annotation.store.test.TestSetup
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec - in uk.org.llgc.annotation.store.test.TestSetup

Results :

Tests in error: 
  TestSearch.loadManifest:124 » Riot invalid remote context: http://iiif.io/api/...
  TestSearch.testEndToEnd:273 » Riot invalid remote context: http://iiif.io/api/...

Tests run: 23, Failures: 0, Errors: 2, Skipped: 0
...

I wonder if it has to do with the redirect of http://iiif.io/api/presentation/2/context.json to https://iiif.io/api/presentation/2/context.json. Could it?

Whole canvas annotation?

Hi Glen,
Playing around with this, it seems to require an xywh region for the annotation. We have transcriptions which haven't been tied to any region of the page, can we do a whole canvas annotation without getting the xywh for the image and creating a whole canvas region?

Allow easy annotation of manifests outside of the defaults

Currently every time you refresh Mirador you lose any manifest you've added. There are two options:

  • Provide a iiif-content parameter to the index page that opens the passed manifest ready for annotating. This is useful for cross linking between SAS and other project websites
  • Add an extra page which loads the stored manifests into Mirador. This will be useful when you have a small number of manifests but will be unwieldy with over 30. This may make more sense when user authentication is added.

Annotations sometimes reappear after deletion

There is a bug in that if you create an annotation and then delete it (without moving pages) then click either the write annotation button or try to create a new annotation the deleted annotation re-appears. Changing pages fixes the issue as the annotation is delete from the annotation store.

Not sure if this is related to the simpleaSEndpoint.js not removing the annotation from the local AnnotationList.

Unicode support

Fetching of annotations breaks on non-ASCII chars, I suppose UTF-8 encoding is missing somewhere.

Error log:`Jun 11, 2016 6:18:32 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Search] in context with path [/anot] threw exception
java.io.CharConversionException: Not an ISO 8859-1 character: Ć
at javax.servlet.ServletOutputStream.print(ServletOutputStream.java:76)
at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:186)
at uk.org.llgc.annotation.store.Search.doGet(Search.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at uk.org.llgc.annotation.store.filters.CorsFilter.doFilter(CorsFilter.java:19)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

`

update or delete annotation lists

Is there a way to update or delete annotation lists?

I have provided annotation lists to the populate form. It's those lists that are identified by their urls, and those annotations marked by their ids that I would like to update or delete.

Be consistent with port choose 8080 or 8888

Currently mvn jetty:run uses port 8888 but using the java -jar dependency/jetty-runner.jar simpleAnnotationStore.war runs on port 8080.

If I change jetty:run I'll have to update the local docs as suggested in:

#55

If I change jetty-runner Ill have to change the IIIF workshops

Document AWS deployment

Document AWS deployment of SAS with Elastic Search as a backend. AWS components:

Deploy / CI

  • Fork SAS repository
  • Setup Code Pipeline
    • Source - github forked repo
    • Build - AWS code build, set privileged
    • Deploy - ECS service

Elastic Container Service

  • Repositories - Docker image store
  • Task - define container (set ENV variables), memory, CPU
  • Service - manages tasks, stop/start/refresh

Elastic Load Balancer

  • Load Balancer - https / http - forwards traffic to target group (can forward https to http)
  • Target Group - SAS Tasks register with this group

Invalid remote context

Hi, I have a problem with the annotating. I first deployed the server with wildfly but when I annotated something I got: org.apache.jena.riot.RiotException: invalid remote context: .....\vfs\temp\temp6f508a3bfaac86cd\content-48a3dfe8e6d53b1c\contexts\iiif-2.0.json
After that I followed the steps in the readme file and deployed it with jetty, but the error still appeared.
In the end I updated the jena dependencies to their last versions but this also didn't solve the problem.
Any help will be highly appreciated.

Error in creating an annotation

I am testing the deployment of 1.0.1 (Java 11) release. I have deployed Solr 8.6.2, though I don't believe this is the problem.

java -version
openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

I load a manifest and then go to a canvas. I can see SAS triggers a Solr query for annotations related to the canvas:

2020-09-14 15:26:03.716 INFO (qtp286649365-17) [ x:annotations] o.a.s.c.S.Request [annotations] webapp=/solr path=/select params={q=target:http\://numismatics.org/archives/manifest/schaefer.rrdp.b01/canvas/schaefer_012-01_b01_p010&fl=id,type,motivation,body,target,selector,short_id,within,data,canvas&start=0&rows=1000&wt=javabin&version=2} hits=0 status=0 QTime=0

I then create an annotation. The SAS log shows some JSON-LD representing the annotation (attached error.log).
error.log.

The gist is this:

2020-09-14 11:27:37.847:WARN:oejs.HttpChannel:qtp1161082381-13: /annotation/create java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')

I can see that SAS posts an update to Solr:

2020-09-14 15:27:37.346 INFO (qtp286649365-41) [ x:annotations] o.a.s.u.p.LogUpdateProcessorFactory [annotations] webapp=/solr path=/update params={wt=javabin&version=2}{add=[http://localhost:8888/annotation/1600097257325 (1677823581714644992)]} 0 5

The Solr panel does indeed show a new doc (attached solr.doc.txt
solr.doc.txt
)

The "data" property seems to be a base64 encoded alphanumeric string. Is this correct?

When I return to the page (click to new page and click back or reload the manifest and start over from scratch), I see that SAS executes a Solr query:

2020-09-14 15:38:33.830 INFO (qtp286649365-21) [ x:annotations] o.a.s.c.S.Request [annotations] webapp=/solr path=/select params={q=target:http\://numismatics.org/archives/manifest/schaefer.rrdp.b01/canvas/schaefer_012-01_b01_p010&fl=id,type,motivation,body,target,selector,short_id,within,data,canvas&start=1&rows=1000&wt=javabin&version=2} hits=1 status=0 QTime=0

which indicates there is one annotation on this canvas, but I'm getting the same SAS error as before:

2020-09-14 11:38:33.831:WARN:oejs.HttpChannel:qtp1161082381-140: /annotation/search java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')

So it seems the annotation is getting created (correctly?) in Solr, but something is getting garbled in between extracting the annotation back from Solr and rendering it in Mirador in SAS. Do you think I should downgrade to Solr 6.x, or is this something else entirely?

Fuseki triples

Hi,

I have been trying to connect Fuseki to view the triple store. Can you add the dataset through the fuseki interface? If so where is the path to the annotations dataset ?

Java errors on /stats

Hi I'm getting an error on /stats
2019-08-26 12:37:30.386:WARN:oejs.ServletHandler:/stats/481c0399e0dda6922cf43823b447ce00.html
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
at uk.org.llgc.annotation.store.data.Manifest.setJson(Manifest.java:29)

  1. Register manifest
  2. Click on it in Stats

And when trying to save an annotation I get another - similar error:
2019-08-26 12:36:43.585:WARN:oejs.ServletHandler:/annotation/create
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
at uk.org.llgc.annotation.store.AnnotationUtils.convertAnnoToModel(AnnotationUtils.java:251)

Its running docker with SOLR as backend.

Regards
Nikolaj

MIrador Fails on Simple Search

Search within is failing in Mirador with the following in console:

Uncaught TypeError: Cannot read property 'total' of undefined
    at $.SearchWithinResults.displayResultCounts (mirador.js:44062)
    at Object.<anonymous> (mirador.js:44047)
    at i (mirador.js:4)
    at Object.fireWith [as resolveWith] (mirador.js:4)
    at A (mirador.js:6)
    at XMLHttpRequest.<anonymous> (mirador.js:6)

I can see the request received in the Jetty console, and the response is:

curl -i http://december16:8888/search-api/MilanWinter2017/search?q=search
HTTP/1.1 200 OK
Content-Type: application/ld+json; charset=UTF-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Requested-With,Content-Type
Access-Control-Allow-Methods: GET,PUT,POST,DELETE
Content-Length: 666
Server: Jetty(6.1.26)

{
  "@type" : "sc:AnnotationList",
  "resources" : [ {
    "@id" : "http://december16:8888/annotation/1528911196020",
    "@type" : "oa:Annotation",
    "dcterms:created" : "2018-06-13T12:33:16",
    "resource" : [ {
      "@id" : "_:b2",
      "@type" : "dctypes:Text",
      "http://dev.llgc.org.uk/sas/full_text" : "search term",
      "format" : "text/html",
      "chars" : "<p>search term</p>"
    } ],
    "on" : "http://december16/iiifp-dec16/MilanWinter2017/canvas/Group#null",
    "motivation" : [ "oa:commenting" ],
    "@context" : "http://iiif.io/api/presentation/2/context.json"
  } ],
  "@context" : "http://iiif.io/api/presentation/2/context.json"
}

Comparing that response to the Search API 1.0, I see that it matches the "simple list" format except for the annotationlist "@id". The property "total" is part of the "paging results" response, not the "simple list" response. Do any of these observations suggest a solution?

How to make the annotations to be readable but not writable

Thanks the developers of SAS!It is really useful and easy to install.

However, I hope I can store the annotations and show the annotations separately. Once I opened SAS, the annotations will show on the pictures, while others could edit them and save them in my SAS store. Can I use another Mirador just showing the annotations? I only have one server. Since I am a freshman, I don't figure out how to build a connection between SAS and the independent Mirador.
How can I do it in one server?

Build Failure using Jetty

Sorry, I'm not a Jetty/Maven expert... using the latest master branch, after running mvn jetty:run I get the following build fail:

...
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 214.9 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.661s
[INFO] Finished at: Tue Aug 25 21:13:41 UTC 2015
[INFO] Final Memory: 8M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

Have you run into this before?

Admin functions

Currently it is difficult to see who and how people are using SAS. To increase visibility administrators should be able to see who is registered with the system and what they are working on. The development in this round will be focused on a single administrator but preparations should be thought about groups of users and if a group can see what others are working on.

The specific features for this round will be:

  • List users registered on the system
    • Last activity date
  • How many manifest in the system (by user)
    • Browse manifests (with number of annotations)
  • View users annotations

Update all libraries and packages

Long past due but ensure Java 11 is now the default. Will require updating the travis build and should probably take the opportunity to look at updating all the libraries.

Need to keep on the same version as Cantaloupe for the workshop. Currently it uses Java 11.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.