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

Issue 612 #38

Merged
merged 7 commits into from
Aug 15, 2017
Merged

Issue 612 #38

merged 7 commits into from
Aug 15, 2017

Conversation

dannylamb
Copy link
Contributor

@dannylamb dannylamb commented Jun 12, 2017

GitHub Issue: Resolves Islandora/documentation#612

What does this Pull Request do?

Adds OPTIONS requests to Houdini and Hypercube so they can be added to Api-X

What's new?

OPTIONS requests for each operation, plus tests. The requests just serve static ttl files describing the services.

How should this be tested?

Pull in the code for this PR and run composer update on both Houdini and Hypercube.

After fcrepo4-labs/fcrepo-api-x#122 lands, you'll need to load the services into Api-X using its loader service.

  • curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services//apix:load"
  • curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/identify" "http://localhost:8081/services//apix:load"
  • curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/hypercube" "http://localhost:8081/services//apix:load"
  • Then, ingest a tiff into Fedora. Mine was located at http://localhost:8080/fcrepo/rest/test.tiff
  • Perform a HEAD request against the tiff through the Api-X proxy: curl -I -H "Authorization: Bearer islandora" http://localhost:8081/fcrepo/rest/test.tiff
  • In the returned headers, you should see a link to discover the services for the tiff. Mine looked like Link: <http://localhost:8081/discovery/test.tiff>; rel="service"
  • GET the discovery document: curl -H "Authorization: Bearer islandora" http://localhost:8081/discovery/test.tiff
  • It should return rdf describing the available services. Mine looked like this:
<>      a       <http://fedora.info/definitions/v4/service#ServiceDocument> ;
        <http://fedora.info/definitions/v4/service#isServiceDocumentFor>
                <http://localhost:8081/fcrepo/rest/test.tiff> ;
        <http://www.openarchives.org/ore/terms/describes>
                <#services> .

<#services>  <http://www.openarchives.org/ore/terms/aggregates>
                <#2c1aa6b6-4bc6-451a-b3f0-80332e1613e8> , <#5335cf4f-c041-45a0-98e9-5a48eaa56d69> , <#229cc418-620b-4a9e-8bc8-60fee5b648ae> .

<#229cc418-620b-4a9e-8bc8-60fee5b648ae>
        a       <http://fedora.info/definitions/v4/service#ServiceInstance> ;
        <http://fedora.info/definitions/v4/service#hasEndpoint>
                <http://localhost:8081/services/test.tiff/svc:convert> ;
        <http://fedora.info/definitions/v4/service#isFunctionOf>
                <http://localhost:8081/fcrepo/rest/test.tiff> ;
        <http://fedora.info/definitions/v4/service#isServiceInstanceOf>
                <http://islandora.ca/CLAW#ConvertService> ;
        <http://fedora.info/definitions/v4/service#serviceInstanceExposedBy>
                <http://localhost:8081/fcrepo/rest/test.tiff> .

<#5335cf4f-c041-45a0-98e9-5a48eaa56d69>
        a       <http://fedora.info/definitions/v4/service#ServiceInstance> ;
        <http://fedora.info/definitions/v4/service#hasEndpoint>
                <http://localhost:8081/services/test.tiff/svc:identify> ;
        <http://fedora.info/definitions/v4/service#isFunctionOf>
                <http://localhost:8081/fcrepo/rest/test.tiff> ;
        <http://fedora.info/definitions/v4/service#isServiceInstanceOf>
                <http://islandora.ca/CLAW#IdentifyService> ;
        <http://fedora.info/definitions/v4/service#serviceInstanceExposedBy>
                <http://localhost:8081/fcrepo/rest/test.tiff> .

<#2c1aa6b6-4bc6-451a-b3f0-80332e1613e8>
        a       <http://fedora.info/definitions/v4/service#ServiceInstance> ;
        <http://fedora.info/definitions/v4/service#hasEndpoint>
                <http://localhost:8081/services/test.tiff/svc:ocr> ;
        <http://fedora.info/definitions/v4/service#isFunctionOf>
                <http://localhost:8081/fcrepo/rest/test.tiff> ;
        <http://fedora.info/definitions/v4/service#isServiceInstanceOf>
                <http://islandora.ca/CLAW#OcrService> ;
        <http://fedora.info/definitions/v4/service#serviceInstanceExposedBy>
                <http://localhost:8081/fcrepo/rest/test.tiff> .
  • As you can see, all three services are available should be available through Api-X. Check out the objects of the http://fedora.info/definitions/v4/service#hasEndpoint triples to see where you can issue an HTTP request.
  • curl -H "Authorization: Bearer islandora" http://localhost:8081/services/test.tiff/svc:identify should return the json from the identify command.
  • curl -H "Authorization: Bearer islandora" http://localhost:8081/services/test.tiff/svc:ocr should return the OCR output
  • curl -H "Authorization: Bearer islandora" -H "Accept: image/png" http://localhost:8081/services/test.tiff/svc:convert should return a png version of the image.

Interested parties

@Islandora-CLAW/committers @ajs6f @birkland

@codecov
Copy link

codecov bot commented Jun 12, 2017

Codecov Report

Merging #38 into master will increase coverage by 0.32%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #38      +/-   ##
============================================
+ Coverage     92.66%   92.98%   +0.32%     
- Complexity       63       66       +3     
============================================
  Files             6        6              
  Lines           327      342      +15     
============================================
+ Hits            303      318      +15     
  Misses           24       24
Impacted Files Coverage Δ Complexity Δ
Hypercube/src/Controller/HypercubeController.php 100% <100%> (ø) 4 <1> (+1) ⬆️
Houdini/src/Controller/HoudiniController.php 98.3% <100%> (+0.34%) 12 <2> (+2) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad6d957...5e307c7. Read the comment docs.

Copy link
Contributor

@ajs6f ajs6f left a comment

Choose a reason for hiding this comment

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

Just some typos noted, mostly that API-X should be capitalized.

@@ -30,15 +30,21 @@ Houdini sets up two endpoints:
- /identify/
- /convert/

Houdini only accepts `GET` requests containing the path an image in Fedora at both of these endpoints.
Houdini is meant for use wtih Api-X, and accepts `GET` and `OPTIONS` requests to those endpoints. The `OPTIONS` requests are for use with the Api-X service loading mechanism, and return RDF describing the
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually API-X (all caps). Also wtih => with

$ curl -H "Authorization: Bearer blabhlahblah" -H "ApixLdpResource: http://localhost:8080/fcrepo/rest/foo/bar" "localhost:8888/identify"
```

But you're probably going to use Houdini through Api-X, which exposes this service as `svc:indentify`. Assuming your Api-X proxy is on port 8081, you can access the service with
Copy link
Contributor

Choose a reason for hiding this comment

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

svc:indentify=>svc:identify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a service that indents everything, lol

@@ -4,7 +4,7 @@

## Introduction

[Tesseract][9] as a microservice.
[Tesseract][9] as a microservice for use with [Api-X][10].
Copy link
Contributor

Choose a reason for hiding this comment

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

API-X all caps

@@ -30,15 +30,21 @@ Houdini sets up two endpoints:
- /identify/
- /convert/

Houdini only accepts `GET` requests containing the path an image in Fedora at both of these endpoints.
Houdini is meant for use wtih Api-X, and accepts `GET` and `OPTIONS` requests to those endpoints. The `OPTIONS` requests are for use with the Api-X service loading mechanism, and return RDF describing the
service for Api-X. The `GET` requests are used to execute the services, and must contain the uri to an image in Fedora in the `ApixLdpResource` header.
Copy link
Contributor

Choose a reason for hiding this comment

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

URI (caps) as used elsewhere in this doc

@@ -45,16 +45,21 @@ In order to work on larger images, be sure `post_max_size` is sufficiently large

## Usage

Hypercube only accepts one request, a `GET` containing the path a TIFF in Fedora.
Hypercube is meant for use with Api-X. It accepts only accepts one request, a `GET` with the URI of a Fedora resource in the `ApixLdpResource` header..
Copy link
Contributor

Choose a reason for hiding this comment

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

API-X

$ curl -H "Authorization: Bearer blabhlahblah" -H "ApixLdpResource: http://localhost:8080/fcrepo/rest/foo/bar" -H "X-Islandora-Args: -psm 9" "http://localhost:8888"
```

But you're probably going to use Hypercube through Api-X, which exposes it as `svc:ocr`. Assuming your Api-X proxy is on port 8081, you can access the service with
Copy link
Contributor

Choose a reason for hiding this comment

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

API-X

@whikloj
Copy link
Member

whikloj commented Jun 13, 2017

@dannylamb I'm not seeing where you are making an OPTIONS request in the testing instructions? Is this something internal to the microservice/API-X interaction?

@dannylamb
Copy link
Contributor Author

dannylamb commented Jun 13, 2017

@whikloj API-X does that for you when posting to the loader service. These three cURLs provide the URL to API-X so it can make the OPTIONS request on your behalf.

  • curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services//apix:load"
  • curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/identify" "http://localhost:8081/services//apix:load"
  • curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/hypercube" "http://localhost:8081/services//apix:load"

API-X was getting blocked when making OPTIONS requests in response to those POSTs due to authentication, which is what led to fcrepo4-labs/fcrepo-api-x#122 being created.

apix:bindsTo <#class> .

<#class> owl:intersectionOf (
fedora:Binary
Copy link
Member

Choose a reason for hiding this comment

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

Should we change this to http://www.w3.org/ns/ldp#NonRDFSource to be repository agnostic and not tie to a "Fedora" type?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes yes yes!

apix:bindsTo <#class> .

<#class> owl:intersectionOf (
fedora:Binary
Copy link
Member

Choose a reason for hiding this comment

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

Same question about using LDP

Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

@whikloj
Copy link
Member

whikloj commented Jun 23, 2017

@dannylamb finally trying this out and my API-X is not happy....actually its not there.

ubuntu@claw:/opt/apache-karaf-4.0.8/etc$ curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services//apix:load" -i
HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Server: Jetty(9.2.19.v20160908)

http://localhost:8000/houdini/convert

Went into Karaf and I see:

karaf@root()> feature:list | grep api-x
fcrepo-api-x                            | 0.2.0            | x        | Started     | fcrepo-api-x-karaf             | All of api-x
fcrepo-api-x-binding                    | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-binding
fcrepo-api-x-listener                   | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-listener
fcrepo-api-x-loader                     | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-loader
fcrepo-api-x-model                      | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-model
fcrepo-api-x-jena                       | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-jena
fcrepo-api-x-registry                   | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-registry
fcrepo-api-x-routing                    | 0.2.0            |          | Started     | fcrepo-api-x-karaf             | fcrepo-api-x-routing
fcrepo-api-x-indexing                   | 0.2.0            |          | Uninstalled | fcrepo-api-x-karaf             | fcrepo-api-x-indexing
fcrepo-api-x-karaf                      | 0.2.0            |          | Uninstalled | fcrepo-api-x-karaf             | fcrepo-api-x-karaf

Is that correct or is my API-X not running correctly?

@whikloj
Copy link
Member

whikloj commented Jun 23, 2017

Also, the API-X pages make reference to various configuration files none of which are installed in our Karaf container. Should they be?

@birkland
Copy link

birkland commented Jun 23, 2017 via email

@dannylamb
Copy link
Contributor Author

@whikloj I made an issue for that: Islandora/documentation#666. Thanks for reminding me. I've updated the dependencies in this PR.

@dannylamb
Copy link
Contributor Author

islandora-deprecated/claw_vagrant#49 has been merged and this is ready to test with the vagrant install. I'll address your feedback shortly, @whikloj

@whikloj
Copy link
Member

whikloj commented Jun 29, 2017

@dannylamb I pulled claw_vagrant@master then pulled the Crayfish branch and ran the composer updates. I can execute OPTIONS requests against both Houdini and Hypercube.

But....

ubuntu@claw:/var/www/html/Crayfish/Hypercube$ curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services//apix:load"
curl: (7) Failed to connect to localhost port 8081: Connection refused

@whikloj
Copy link
Member

whikloj commented Jun 29, 2017

Oh wait, this might be because we still haven't fix ActiveMQ. I better get my OpenSeadragon PR updated.

Except now...

ubuntu@claw:/opt/apache-karaf-4.0.8/data/log$ curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services/apix:load"
http://localhost:8000/houdini/convertubuntu@claw:/opt/apache-karaf-4.0.8/data/log$

and karaf.log says

2017-06-29 16:19:09,995 | INFO  | p1370227789-1044 | RoutingImpl                      | 142 - fcrepo-api-x-routing - 0.3.0.SNAPSHOT | No binding for http://localhost:8081/services/apix:load
2017-06-29 16:19:09,996 | DEBUG | p1370227789-1044 | FilterProcessor                  | 68 - org.apache.camel.camel-core - 2.18.4 | Filter matches: true for exchange: Exchange[ID-claw-43916-1498742555921-4-3]
2017-06-29 16:19:09,996 | DEBUG | p1370227789-1044 | SendProcessor                    | 68 - org.apache.camel.camel-core - 2.18.4 | >>>> direct://extension_not_found Exchange[ID-claw-43916-1498742555921-4-3]
2017-06-29 16:19:09,997 | DEBUG | p1370227789-1044 | DefaultHttpBinding               | 147 - org.apache.camel.camel-http-common - 2.18.4 | Streaming response in chunked mode with buffer size 32768

@whikloj
Copy link
Member

whikloj commented Jul 7, 2017

@dannylamb @birkland I tried this again by destroying my vagrant and pulling a fresh copy from master.

Before doing anything I went into the vagrant machine and tailed the karaf.log and it appears that API-X is not initializing correctly.
https://gist.github.com/whikloj/c55e3b40c8a324b73413664190e406e3

I'm sorry that I don't understand what API-X does or how it does it, but currently it is a black box to me.

I tried to feature:stop and feature:start fcrepo-api-x-registry, fcrepo-api-x-loader and the base fcrepo-api-x hoping that might right the ship, but currently it seems I need to destroy karaf and reload API-X entirely. Perhaps I'll spend some time today with the api-x demos and learning how to use Docker for them.

@birkland
Copy link

birkland commented Jul 7, 2017

@whikloj Sometimes, it can be particularly difficult to understand what's happening in Karaf, and why.

So API-X in Docker is easy. All it's doing is feature:install fcrepo-api-x. For CLAW, there's one additional twist: a custom HttpClient is published to the OSGi registry that is configured to authenticate via JWT. this section of the api-x registry blueprint listens for all OSGi services of interface org.apache.http.client.HttpClient. CLAW provides one, somehow (I don't know the details of how it's created or implemented).

I think the exception is coming from this injected HttpClient. If so, then that would be the next place to look.

@dannylamb
Copy link
Contributor Author

@whikloj This one is new to me. I'll wrap up what I've got going right now and vagrant up again.

@dannylamb
Copy link
Contributor Author

@whikloj I just checked the results of a fresh vagrant up and can't reproduce the error you're seeing. Is there anything you were doing to get those errors? Or they were just waiting for you in the logs after install?

@whikloj
Copy link
Member

whikloj commented Jul 10, 2017

Yeah, I just went straight into the karaf log after the vagrant came up and saw them there. I wanted to ensure I had the right version of API-X. If you aren't seeing any errors, then I'll give it another go.

@dannylamb
Copy link
Contributor Author

@whikloj Here's hoping it was just a Maven timeout. 🙏

@whikloj
Copy link
Member

whikloj commented Jul 11, 2017

@dannylamb I don't know what I'm doing wrong, here is my terminal from the completion of vagrant up to my attempt at the first curl command.

==> default: Running provisioner: shell...
    default: Running: /var/folders/w3/9tw0brpn0xg9gr2q6ct9zty80000gp/T/vagrant-shell20170711-5200-1saspcm.sh
==> default: RUNNING POST-INSTALL COMMANDS
==> default: Cache rebuild complete.                                                     [ok]
[whikloj@net227.lib.umanitoba.ca 15:10 ] 
[/sw/var/www/DAM2/claw_vagrant] 
> vagrant ssh
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-66-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

7 packages can be updated.
7 updates are security updates.


*** System restart required ***
                      _______     
             \\ //   /   -^--\ |  
             ||||   / /\_____/ /  
  {\         ______{ }        /   
  {_}{\{\{\{|         \=@____/    
 <{_{-{-{-{-| ====---- >>>        
  { }{/{/{/{|______  _/=@_____    
  {/               { }        \   
             ||||  \ \______   \  
             // \\   \    _^_\ |  
                      \______/    




    __  _       ____  __    __ 
   /  ]| T     /    T|  T__T  T
  /  / | |    Y  o  ||  |  |  |
 /  /  | l___ |     ||  |  |  |
/   \_ |     T|  _  |l  `  '  !
\     ||     ||  |  | \      / 
 \____jl_____jl__j__j  \_/\_/  
                               
ubuntu@claw:~$ tail -f /opt/apache-karaf-4.0.8/data/log/karaf.log
2017-07-11 20:08:28,457 | INFO  | pool-2-thread-1  | FeaturesServiceImpl              | 8 - org.apache.karaf.features.core - 4.0.8 |   org.fcrepo.camel.fcrepo-indexing-triplestore-blueprint/4.7.2
2017-07-11 20:08:28,459 | INFO  | pool-2-thread-1  | BlueprintContainerImpl           | 12 - org.apache.aries.blueprint.core - 1.7.1 | Bundle org.fcrepo.camel.fcrepo-indexing-triplestore-blueprint/4.7.2 is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]
2017-07-11 20:08:28,460 | DEBUG | pool-2-thread-1  | Activator                        | 68 - org.apache.camel.camel-core - 2.18.4 | Bundle started: org.fcrepo.camel.fcrepo-indexing-triplestore-blueprint
2017-07-11 20:08:28,460 | DEBUG | pool-2-thread-1  | Activator                        | 124 - org.apache.camel.camel-core - 2.18.1 | Bundle started: org.fcrepo.camel.fcrepo-indexing-triplestore-blueprint
2017-07-11 20:08:28,461 | INFO  | pool-2-thread-1  | bundle                           | 146 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | Bundle Considered for SPI providers: org.fcrepo.camel.fcrepo-indexing-triplestore-blueprint
2017-07-11 20:08:28,461 | INFO  | pool-2-thread-1  | bundle                           | 146 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | No 'SPI-Provider' Manifest header. Skipping bundle: org.fcrepo.camel.fcrepo-indexing-triplestore-blueprint
2017-07-11 20:08:28,461 | INFO  | pool-2-thread-1  | FeaturesServiceImpl              | 8 - org.apache.karaf.features.core - 4.0.8 | Done.
2017-07-11 20:08:30,111 | INFO  | l-/opt/karaf/etc | fileinstall                      | 4 - org.apache.felix.fileinstall - 3.5.6 | Updating configuration from ca.islandora.alpaca.indexing.triplestore.cfg
2017-07-11 20:08:30,113 | INFO  | l-/opt/karaf/etc | fileinstall                      | 4 - org.apache.felix.fileinstall - 3.5.6 | Updating configuration from ca.islandora.alpaca.connector.broadcast.cfg
2017-07-11 20:08:30,115 | INFO  | l-/opt/karaf/etc | fileinstall                      | 4 - org.apache.felix.fileinstall - 3.5.6 | Creating configuration from org.fcrepo.camel.indexing.triplestore.cfg
^C
ubuntu@claw:~$ cd /var/www/html/Crayfish/
ubuntu@claw:/var/www/html/Crayfish$ git remote -v
origin	https://github.com/Islandora-CLAW/Crayfish.git (fetch)
origin	https://github.com/Islandora-CLAW/Crayfish.git (push)
ubuntu@claw:/var/www/html/Crayfish$ git remote add danny https://github.com/dannylamb/Crayfish.git
ubuntu@claw:/var/www/html/Crayfish$ git fetch danny 
remote: Counting objects: 335, done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 335 (delta 132), reused 161 (delta 129), pack-reused 166
Receiving objects: 100% (335/335), 75.21 KiB | 0 bytes/s, done.
Resolving deltas: 100% (167/167), completed with 41 local objects.
From https://github.com/dannylamb/Crayfish
 * [new branch]      add-gemini -> danny/add-gemini
 * [new branch]      add-hypercube -> danny/add-hypercube
 * [new branch]      issue-611  -> danny/issue-611
 * [new branch]      issue-612  -> danny/issue-612
 * [new branch]      issue-640  -> danny/issue-640
 * [new branch]      master     -> danny/master
 * [new branch]      milliner   -> danny/milliner
 * [new branch]      milliner-binary -> danny/milliner-binary
 * [new branch]      path-mapper -> danny/path-mapper
 * [new branch]      use-crayfish-commons -> danny/use-crayfish-commons
ubuntu@claw:/var/www/html/Crayfish$ git checkout -b issue-612 danny/issue-612
Branch issue-612 set up to track remote branch issue-612 from danny.
Switched to a new branch 'issue-612'
ubuntu@claw:/var/www/html/Crayfish$ cd Houdini/
ubuntu@claw:/var/www/html/Crayfish/Houdini$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 27 updates, 0 removals
  - Updating symfony/polyfill-mbstring (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/dom-crawler (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/browser-kit (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/css-selector (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/yaml (v3.2.7 => v3.3.4): Loading from cache
  - Updating sebastian/diff (1.4.1 => 1.4.3): Downloading (100%)         
  - Updating phpunit/phpunit-mock-objects (3.4.3 => 3.4.4): Downloading (100%)         
  - Updating phpunit/phpunit (5.7.19 => 5.7.21): Downloading (100%)         
  - Updating squizlabs/php_codesniffer (2.8.1 => 2.9.1): Loading from cache
  - Updating monolog/monolog (1.22.1 => 1.23.0): Downloading (100%)         
  - Updating symfony/routing (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/event-dispatcher (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/debug (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/http-kernel (v3.2.7 => v3.2.11): Downloading (100%)         
  - Installing psr/container (1.0.0): Downloading (100%)         
  - Updating pimple/pimple (v3.0.2 => v3.1.0): Downloading (100%)         
  - Updating silex/silex (v2.0.4 => v2.1.0): Downloading (100%)         
  - Updating symfony/polyfill-php70 (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/inflector (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/property-access (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating symfony/polyfill-util (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/polyfill-php56 (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/security (v3.2.7 => v3.2.11): Downloading (100%)         
  - Updating symfony/console (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating guzzlehttp/guzzle (6.2.3 => 6.3.0): Downloading (100%)         
  - Updating symfony/finder (v3.2.7 => v3.3.4): Downloading (100%)         
  - Updating theseer/fdomdocument (1.6.5 => 1.6.6): Downloading (100%)         
  - Updating islandora/crayfish-commons dev-master (3957f46 => f653297):  Checking out f6532974f8
Writing lock file
Generating autoload files
ubuntu@claw:/var/www/html/Crayfish/Houdini$ cd ../Hypercube/
ubuntu@claw:/var/www/html/Crayfish/Hypercube$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 27 updates, 0 removals
  - Updating symfony/routing (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/polyfill-mbstring (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/event-dispatcher (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/debug (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/http-kernel (v3.2.7 => v3.2.11): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Updating pimple/pimple (v3.0.2 => v3.1.0): Loading from cache
  - Updating silex/silex (v2.0.4 => v2.1.0): Loading from cache
  - Updating symfony/dom-crawler (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/browser-kit (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/css-selector (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/yaml (v3.2.7 => v3.3.4): Loading from cache
  - Updating sebastian/diff (1.4.1 => 1.4.3): Loading from cache
  - Updating phpunit/phpunit-mock-objects (3.4.3 => 3.4.4): Loading from cache
  - Updating phpunit/phpunit (5.7.19 => 5.7.21): Loading from cache
  - Updating squizlabs/php_codesniffer (2.8.1 => 2.9.1): Loading from cache
  - Updating monolog/monolog (1.22.1 => 1.23.0): Loading from cache
  - Updating symfony/polyfill-php70 (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/inflector (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/property-access (v3.2.7 => v3.3.4): Loading from cache
  - Updating symfony/polyfill-util (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/polyfill-php56 (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/security (v3.2.7 => v3.2.11): Loading from cache
  - Updating symfony/console (v3.2.7 => v3.3.4): Loading from cache
  - Updating guzzlehttp/guzzle (6.2.3 => 6.3.0): Loading from cache
  - Updating symfony/finder (v3.2.7 => v3.3.4): Loading from cache
  - Updating theseer/fdomdocument (1.6.5 => 1.6.6): Loading from cache
  - Updating islandora/crayfish-commons dev-master (3957f46 => f653297):  Checking out f6532974f8
Writing lock file
Generating autoload files
ubuntu@claw:/var/www/html/Crayfish/Hypercube$ curl -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services//apix:load"
curl: (7) Failed to connect to localhost port 8081: Connection refused

@dannylamb
Copy link
Contributor Author

@whikloj From the karaf console, what does la | grep api-x return?

@whikloj
Copy link
Member

whikloj commented Jul 12, 2017

@dannylamb currently, though I have been using this vagrant to work the JsonLd PR, it says.

karaf@root()> la | grep api-x
136 | Active      |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-binding
137 | Active      |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-jena
138 | GracePeriod |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-listener
139 | GracePeriod |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-loader
140 | Active      |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-model
141 | Active      |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-registry
142 | GracePeriod |  80 | 0.3.0.SNAPSHOT     | fcrepo-api-x-routing

@dannylamb
Copy link
Contributor Author

Just re-ran through this again on a fresh box and there was one hiccup, but everything turned out ok.

Pulled down the code.

ubuntu@claw:/var/www/html/Crayfish$ git checkout -b dannylamb-issue-612 master
Switched to a new branch 'dannylamb-issue-612'

ubuntu@claw:/var/www/html/Crayfish$ git pull https://github.com/dannylamb/Crayfish.git issue-612
remote: Counting objects: 80, done.
remote: Total 80 (delta 30), reused 30 (delta 30), pack-reused 50
Unpacking objects: 100% (80/80), done.
From https://github.com/dannylamb/Crayfish
 * branch            issue-612  -> FETCH_HEAD
Updating ad6d957..5e307c7
Fast-forward
 Houdini/README.md                                                     |  19 +++-
 Houdini/composer.lock                                                 | 373 +++++++++++++++++++++++++++++++++--------------------------------
 Houdini/src/Controller/HoudiniController.php                          |  25 +++++
 Houdini/src/app.php                                                   |  18 ++--
 Houdini/static/convert.ttl                                            |  18 ++++
 Houdini/static/identify.ttl                                           |  18 ++++
 Houdini/tests/Islandora/Houdini/Tests/HoudiniControllerTest.php       |  74 +++++--------
 Hypercube/README.md                                                   |  14 ++-
 Hypercube/composer.lock                                               | 373 +++++++++++++++++++++++++++++++++--------------------------------
 Hypercube/src/Controller/HypercubeController.php                      |  12 ++-
 Hypercube/src/app.php                                                 |   2 +
 Hypercube/static/hypercube.ttl                                        |  18 ++++
 Hypercube/tests/Islandora/Hypercube/Tests/HypercubeControllerTest.php |  19 ++++
 13 files changed, 557 insertions(+), 426 deletions(-)
 create mode 100644 Houdini/static/convert.ttl
 create mode 100644 Houdini/static/identify.ttl
 create mode 100644 Hypercube/static/hypercube.ttl

Composer updated Hypercube and Houdini

ubuntu@claw:/var/www/html/Crayfish$ cd Hypercube

ubuntu@claw:/var/www/html/Crayfish/Hypercube$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 33 updates, 0 removals
  - Updating symfony/routing (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/polyfill-mbstring (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/event-dispatcher (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/debug (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/http-kernel (v3.2.7 => v3.2.13): Downloading (100%)         
  - Installing psr/container (1.0.0): Downloading (100%)         
  - Updating pimple/pimple (v3.0.2 => v3.2.2): Downloading (100%)         
  - Updating silex/silex (v2.0.4 => v2.2.0): Downloading (100%)         
  - Updating symfony/dom-crawler (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/browser-kit (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/css-selector (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/yaml (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating sebastian/diff (1.4.1 => 1.4.3): Downloading (100%)         
  - Updating phpunit/phpunit-mock-objects (3.4.3 => 3.4.4): Downloading (100%)         
  - Updating phpdocumentor/type-resolver (0.2.1 => 0.4.0): Downloading (100%)         
  - Updating phpdocumentor/reflection-docblock (3.1.1 => 3.2.0): Downloading (100%)         
  - Updating phpunit/phpunit (5.7.19 => 5.7.21): Downloading (100%)         
  - Updating squizlabs/php_codesniffer (2.8.1 => 2.9.1): Loading from cache
  - Updating doctrine/inflector (v1.1.0 => v1.2.0): Downloading (100%)         
  - Updating doctrine/cache (v1.6.1 => v1.6.2): Downloading (100%)         
  - Updating doctrine/common (v2.7.2 => v2.7.3): Downloading (100%)         
  - Updating doctrine/dbal (v2.5.12 => v2.5.13): Downloading (100%)         
  - Updating monolog/monolog (1.22.1 => 1.23.0): Downloading (100%)         
  - Updating symfony/polyfill-php70 (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/inflector (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/property-access (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating symfony/polyfill-util (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/polyfill-php56 (v1.3.0 => v1.4.0): Downloading (100%)         
  - Updating symfony/security (v3.2.7 => v3.2.13): Downloading (100%)         
  - Updating symfony/console (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating guzzlehttp/guzzle (6.2.3 => 6.3.0): Downloading (100%)         
  - Updating symfony/finder (v3.2.7 => v3.3.6): Downloading (100%)         
  - Updating theseer/fdomdocument (1.6.5 => 1.6.6): Downloading (100%)         
  - Updating islandora/crayfish-commons dev-master (3957f46 => f653297):  Checking out f6532974f8
Writing lock file
Generating autoload files

ubuntu@claw:/var/www/html/Crayfish/Hypercube$ cd ../Houdini

ubuntu@claw:/var/www/html/Crayfish/Houdini$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 33 updates, 0 removals
  - Updating symfony/polyfill-mbstring (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/dom-crawler (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/browser-kit (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/css-selector (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/yaml (v3.2.7 => v3.3.6): Loading from cache
  - Updating sebastian/diff (1.4.1 => 1.4.3): Loading from cache
  - Updating phpunit/phpunit-mock-objects (3.4.3 => 3.4.4): Loading from cache
  - Updating phpdocumentor/type-resolver (0.2.1 => 0.4.0): Loading from cache
  - Updating phpdocumentor/reflection-docblock (3.1.1 => 3.2.0): Loading from cache
  - Updating phpunit/phpunit (5.7.19 => 5.7.21): Loading from cache
  - Updating squizlabs/php_codesniffer (2.8.1 => 2.9.1): Loading from cache
  - Updating doctrine/inflector (v1.1.0 => v1.2.0): Loading from cache
  - Updating doctrine/cache (v1.6.1 => v1.6.2): Loading from cache
  - Updating doctrine/common (v2.7.2 => v2.7.3): Loading from cache
  - Updating doctrine/dbal (v2.5.12 => v2.5.13): Loading from cache
  - Updating monolog/monolog (1.22.1 => 1.23.0): Loading from cache
  - Updating symfony/routing (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/event-dispatcher (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/debug (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/http-kernel (v3.2.7 => v3.2.13): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Updating pimple/pimple (v3.0.2 => v3.2.2): Loading from cache
  - Updating silex/silex (v2.0.4 => v2.2.0): Loading from cache
  - Updating symfony/polyfill-php70 (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/inflector (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/property-access (v3.2.7 => v3.3.6): Loading from cache
  - Updating symfony/polyfill-util (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/polyfill-php56 (v1.3.0 => v1.4.0): Loading from cache
  - Updating symfony/security (v3.2.7 => v3.2.13): Loading from cache
  - Updating symfony/console (v3.2.7 => v3.3.6): Loading from cache
  - Updating guzzlehttp/guzzle (6.2.3 => 6.3.0): Loading from cache
  - Updating symfony/finder (v3.2.7 => v3.3.6): Loading from cache
  - Updating theseer/fdomdocument (1.6.5 => 1.6.6): Loading from cache
  - Updating islandora/crayfish-commons dev-master (3957f46 => f653297):  Checking out f6532974f8
Writing lock file
Generating autoload files

Loaded the services into Api-X

ubuntu@claw:/var/www/html/Crayfish/Houdini$ cd ..

ubuntu@claw:/var/www/html/Crayfish$ curl -i -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/convert" "http://localhost:8081/services//apix:load"
HTTP/1.1 200 OK
Content-Type: text/turtle;charset=UTF-8
Accept: */*
Accept-Encoding: gzip,deflate
Accept-Ranges: bytes
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Apix-Exposed-Uri: http://localhost:8081/services//apix:load
Apix-Ldp-Root: http://localhost:8080/fcrepo/rest
Apix-Modality: intercept; outgoing
Apix-Root: http://localhost:8081/fcrepo/rest/
Authorization: Bearer islandora
breadcrumbId: ID-claw-39920-1501081774825-4-2
Content-Disposition: attachment; filename="houdini-convert"; creation-date="Tue, 01 Aug 2017 14:48:17 GMT"; modification-date="Tue, 01 Aug 2017 14:48:17 GMT"; size=796
ETag: "ddbca401c847ee9ff89c6006e72e3c5dd3365b01"
ETag: "ddbca401c847ee9ff89c6006e72e3c5dd3365b01"
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Last-Modified: Tue, 01 Aug 2017 14:48:17 GMT
Last-Modified: Tue, 01 Aug 2017 14:48:17 GMT
Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://localhost:8081/fcrepo/rest/apix/extensions/houdini-convert/fcr:metadata>; rel="describedby"
Link: <http://localhost:8081/discovery/apix/extensions/houdini-convert>; rel="service"
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked

@prefix apix:<http://fedora.info/definitions/v4/api-extension#> .
@prefix owl:<http://www.w3.org/2002/07/owl#> .
@prefix ebucore:<http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp:<http://www.w3.org/ns/ldp#> .
@prefix islandora:<http://islandora.ca/CLAW#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .

<> a apix:Extension;
    rdfs:label "Image Conversion Service";
    rdfs:comment "imagemagick's convert as a microservice";
    apix:exposesService islandora:ConvertService;
    apix:exposesServiceAt "svc:convert";
    apix:bindsTo <#class> .

<#class> owl:intersectionOf (
        ldp:NonRDFSource
        [ a owl:Restriction; owl:onProperty ebucore:hasMimeType; owl:hasValue "image/tiff", "image/jp2", "image/jpeg", "image/png", "image/gif", "image/bmp" ]
) .

ubuntu@claw:/var/www/html/Crayfish$ curl -i -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/houdini/identify" "http://localhost:8081/services//apix:load"
HTTP/1.1 200 OK
Content-Type: text/turtle;charset=UTF-8
Accept: */*
Accept-Encoding: gzip,deflate
Accept-Ranges: bytes
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Apix-Exposed-Uri: http://localhost:8081/services//apix:load
Apix-Ldp-Root: http://localhost:8080/fcrepo/rest
Apix-Modality: intercept; outgoing
Apix-Root: http://localhost:8081/fcrepo/rest/
Authorization: Bearer islandora
breadcrumbId: ID-claw-39920-1501081774825-4-8
Content-Disposition: attachment; filename="houdini-identify"; creation-date="Tue, 01 Aug 2017 14:49:03 GMT"; modification-date="Tue, 01 Aug 2017 14:49:03 GMT"; size=803
ETag: "bec1940f3342306a20968ce205a440d4b07b6364"
ETag: "bec1940f3342306a20968ce205a440d4b07b6364"
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Last-Modified: Tue, 01 Aug 2017 14:49:03 GMT
Last-Modified: Tue, 01 Aug 2017 14:49:03 GMT
Link: <http://localhost:8081/fcrepo/rest/apix/extensions/houdini-identify/fcr:metadata>; rel="describedby"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://localhost:8081/discovery/apix/extensions/houdini-identify>; rel="service"
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked

@prefix apix:<http://fedora.info/definitions/v4/api-extension#> .
@prefix owl:<http://www.w3.org/2002/07/owl#> .
@prefix ebucore:<http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp:<http://www.w3.org/ns/ldp#> .
@prefix islandora:<http://islandora.ca/CLAW#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .

<> a apix:Extension;
    rdfs:label "Image Identification Service";
    rdfs:comment "imagemagick's identify as a microservice";
    apix:exposesService islandora:IdentifyService;
    apix:exposesServiceAt "svc:identify";
    apix:bindsTo <#class> .

<#class> owl:intersectionOf (
        ldp:NonRDFSource
        [ a owl:Restriction; owl:onProperty ebucore:hasMimeType; owl:hasValue "image/tiff", "image/jp2", "image/jpeg", "image/png", "image/gif", "image/bmp" ]
) .

I missed a trailing slash on the install instructions for the command to load Hypercube into api-x. Here's the corrected command:

ubuntu@claw:/var/www/html/Crayfish$ curl -i -X POST -H "Authorization: Bearer islandora" -H "Content-Type: text/plain" -d "http://localhost:8000/hypercube/" "http://localhost:8081/services//apix:load"
HTTP/1.1 200 OK
Content-Type: text/turtle;charset=UTF-8
Accept: */*
Accept-Encoding: gzip,deflate
Accept-Ranges: bytes
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Apix-Exposed-Uri: http://localhost:8081/services//apix:load
Apix-Ldp-Root: http://localhost:8080/fcrepo/rest
Apix-Modality: intercept; outgoing
Apix-Root: http://localhost:8081/fcrepo/rest/
Authorization: Bearer islandora
breadcrumbId: ID-claw-39920-1501081774825-4-17
Content-Disposition: attachment; filename="hypercube"; creation-date="Tue, 01 Aug 2017 14:50:31 GMT"; modification-date="Tue, 01 Aug 2017 14:50:31 GMT"; size=712
ETag: "791e49c21a404ad7a1a2d66b650673e926cc6787"
ETag: "791e49c21a404ad7a1a2d66b650673e926cc6787"
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Last-Modified: Tue, 01 Aug 2017 14:50:31 GMT
Last-Modified: Tue, 01 Aug 2017 14:50:31 GMT
Link: <http://localhost:8081/fcrepo/rest/apix/extensions/hypercube/fcr:metadata>; rel="describedby"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
Link: <http://localhost:8081/discovery/apix/extensions/hypercube>; rel="service"
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked

@prefix apix:<http://fedora.info/definitions/v4/api-extension#> .
@prefix owl:<http://www.w3.org/2002/07/owl#> .
@prefix ebucore:<http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp:<http://www.w3.org/ns/ldp#> .
@prefix islandora:<http://islandora.ca/CLAW#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .

<> a apix:Extension;
    rdfs:label "Tesseract OCR Service";
    rdfs:comment "A service that runs OCR on tiffs";
    apix:exposesService islandora:OcrService;
    apix:exposesServiceAt "svc:ocr";
    apix:bindsTo <#class> .

<#class> owl:intersectionOf (
        ldp:NonRDFSource
        [ a owl:Restriction; owl:onProperty ebucore:hasMimeType; owl:hasValue "image/tiff" ]
) .

Then I ingested a tiff and Fedora gave it a location of http://localhost:8080/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902.

I grabbed the service document with

ubuntu@claw:/var/www/html/Crayfish$ curl -I -H "Authorization: Bearer islandora" "http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902"
HTTP/1.1 200 OK
Content-Type: image/tiff
Accept: */*
Accept-Ranges: bytes
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Apix-Modality: intercept; outgoing
Authorization: Bearer islandora
breadcrumbId: ID-claw-39920-1501081774825-4-23
Content-Disposition: attachment; filename=""; creation-date="Fri, 21 Jul 2017 14:03:44 GMT"; modification-date="Fri, 21 Jul 2017 14:03:44 GMT"; size=10409
ETag: "87e7b7c59955cc47422eccae3b6b0bde336c151f"
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Last-Modified: Fri, 21 Jul 2017 14:03:44 GMT
Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
Link: <http://localhost:8081/discovery/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902>; rel="service"
Link: <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902/fcr:metadata>; rel="describedby"
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Server: Apache-Coyote/1.1
Content-Length: 0

ubuntu@claw:/var/www/html/Crayfish$ curl -H "Authorization: Bearer islandora" http://localhost:8081/discovery/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902
<>      a       <http://fedora.info/definitions/v4/service#ServiceDocument> ;
        <http://fedora.info/definitions/v4/service#isServiceDocumentFor>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> ;
        <http://www.openarchives.org/ore/terms/describes>
                <#services> .

<#5221a349-4f55-441f-aa54-8cb32e48ecea>
        a       <http://fedora.info/definitions/v4/service#ServiceInstance> ;
        <http://fedora.info/definitions/v4/service#hasEndpoint>
                <http://localhost:8081/services/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902/svc:convert> ;
        <http://fedora.info/definitions/v4/service#isFunctionOf>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> ;
        <http://fedora.info/definitions/v4/service#isServiceInstanceOf>
                <http://islandora.ca/CLAW#ConvertService> ;
        <http://fedora.info/definitions/v4/service#serviceInstanceExposedBy>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> .

<#services>  <http://www.openarchives.org/ore/terms/aggregates>
                <#88bb2f51-dc1d-4d7d-82c9-5ab13d4324de> , <#cf60cc7e-90c8-4b2a-bd4a-17eeaff6d19d> , <#5221a349-4f55-441f-aa54-8cb32e48ecea> .

<#cf60cc7e-90c8-4b2a-bd4a-17eeaff6d19d>
        a       <http://fedora.info/definitions/v4/service#ServiceInstance> ;
        <http://fedora.info/definitions/v4/service#hasEndpoint>
                <http://localhost:8081/services/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902/svc:identify> ;
        <http://fedora.info/definitions/v4/service#isFunctionOf>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> ;
        <http://fedora.info/definitions/v4/service#isServiceInstanceOf>
                <http://islandora.ca/CLAW#IdentifyService> ;
        <http://fedora.info/definitions/v4/service#serviceInstanceExposedBy>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> .

<#88bb2f51-dc1d-4d7d-82c9-5ab13d4324de>
        a       <http://fedora.info/definitions/v4/service#ServiceInstance> ;
        <http://fedora.info/definitions/v4/service#hasEndpoint>
                <http://localhost:8081/services/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902/svc:ocr> ;
        <http://fedora.info/definitions/v4/service#isFunctionOf>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> ;
        <http://fedora.info/definitions/v4/service#isServiceInstanceOf>
                <http://islandora.ca/CLAW#OcrService> ;
        <http://fedora.info/definitions/v4/service#serviceInstanceExposedBy>
                <http://localhost:8081/fcrepo/rest/d1/76/35/80/d1763580-1d5e-441d-838d-cfad0a7e3902> .

And then executed hypercube with

ubuntu@claw:/var/www/html/Crayfish$ curl -H "Authorization: Bearer islandora" "http://localhost:8081/services/d1/76/35/80/d1763580-1d5e-8d-cfad0a7e3902/svc:ocr"
SAMPLE [MA GE

 

SAMPLE [MA GE

My tiff has "Sample Image" written on it twice, hence tesseract's output there.

@dannylamb
Copy link
Contributor Author

@ajs6f ^^

@ajs6f
Copy link
Contributor

ajs6f commented Aug 11, 2017

Tried these latest instructions with success. Simple OCR results, as expected!

@dannylamb
Copy link
Contributor Author

Islandora/documentation#686 aside, this has been reviewed and tested successfully. @Islandora-CLAW/committers Can we get this in? It's sat for long enough.

@DiegoPino
Copy link
Contributor

@dannylamb should we wait for @whikloj to come back from vacations? He was running into trouble running this. Just to have his blessing 👍

@whikloj
Copy link
Member

whikloj commented Aug 14, 2017 via email

@dannylamb
Copy link
Contributor Author

@whikloj 🏖️ 🍻

@ajs6f
Copy link
Contributor

ajs6f commented Aug 15, 2017

@whikloj Man, do what I did: have your toddler daughter erase your phone on the first day of your trip. Solved all those "just going to check my work email real quick" problems, real quick.

First vacation I actually enjoyed in several years.

@DiegoPino
Copy link
Contributor

OK, merging. I trust the 75% success rate =)

@DiegoPino DiegoPino merged commit 05b651e into Islandora:master Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants