Skip to content

mbuechner/ef2so

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java CI with Maven Docker

EF2SO - An Entity Facts-To-Schema.org Converter

This is an on-demand Entity Facts (EF) to Schema.org Converter. That means, that the transformation work will be done in the moment of access! URL schema is http://www.example.org/yourpath/{GND-IDN}.

EF2SO at DDBlabs: https://labs.ddb.de/app/ef2so/118540238

Entity types

  • Supported: organisation, person and place
  • Unsupported: family (due to a lack in Schema.org)

Workflow

  1. Request: http://www.example.org/yourpath/118540238
  2. Get data from Entity Facts: http://hub.culturegraph.org/entityfacts/118540238
  3. Transform data (JSON-LD to JSON-LD): Transformation (Mapping) is made with Metafacture

Contribution

Thanks to Jana Hentschke for providing the conceptual mapping (Entity Facts data model to Schema.org data model).

Compile & Deploy

  1. Download Maven Project from this repository.
  2. Install Maven project management tool.
  3. Run in the folder with pom.xml the following command: mvn clean package
  4. Take target\ef2so.warand deploy it on your web server.
  5. Open Browser, if you're running a local Tomcat: http://localhost:8080/118540238

Docker

Yes, there's a docker container for EF2SO available at GitHub. See https://github.com/mbuechner?tab=packages&repo_name=ef2so

docker pull ghcr.io/mbuechner/ef2so/ef2so:latest

Container build

  1. Checkout GitHub repository: git clone https://github.com/mbuechner/ef2so
  2. Go into folder: cd ef2so
  3. Run docker build -t ef2so .
  4. Start container with: docker run -d -p 8080:8080 -P ef2so
  5. Open browser: http://localhost:8080/118540238

Note: The container is listen on port 8080. If you need a path prefix start container e.g. with docker run -d -p 8080:8080 -P --env "URLPATTERN=/foo/bar/*" ef2so and application will be available under http://localhost:8080/foo/bar/118540238

How to use it on your website?

See Google's documentation. It's better to dynamically inject the Schema.org-JSON-LD, than waiting for the service. Google does support that! It's basically:

<script type="application/ld+json">
{
   "@id":"http://d-nb.info/gnd/118540238",
   "@context":"http://schema.org/",
   "@type":"Person",
   "name":"Johann Wolfgang von Goethe",
   "birthDate":"28. August 1749",
   "deathDate":"22. März 1832",
   ...
}
</script>

Link-Element

As far as I know it is not possible to use the link element and refer to the Schema.org data.

<link href="http://www.example.org/yourpath/118540238" rel="alternate" type="application/ld+json" />

Performance

First, that depends on your webserver of course! A non-representative benchmark showed that requests to EF2SO are only 33% slower than requests to Entity Facts.

Benchmark

Setup

  • Virtual Users: 10 (cloud servers located in the USA)
  • Entity Facts and EF2SO servers located in Frankfurt, Germany
  • Duration 30sec.
  • Request rate: up to 150r/sec.

Results

  • EF2SO: avg. 765.58ms
  • Entity Facts: avg. 573.25ms
% HTTP Status Code Service URL LoadTime (ms)
100 200 EF https://hub.culturegraph.org/entityfacts/100025250 520
100 200 EF https://hub.culturegraph.org/entityfacts/100000193 472
100 200 EF https://hub.culturegraph.org/entityfacts/100001394 555
100 200 EF https://hub.culturegraph.org/entityfacts/100000355 483
100 200 EF https://hub.culturegraph.org/entityfacts/140585524 569
100 200 EF https://hub.culturegraph.org/entityfacts/100054102 659
100 200 EF https://hub.culturegraph.org/entityfacts/118577182 543
100 200 EF https://hub.culturegraph.org/entityfacts/100014704 601
100 200 EF https://hub.culturegraph.org/entityfacts/118540238 629
100 200 EF https://hub.culturegraph.org/entityfacts/118505556 589
100 200 EF https://hub.culturegraph.org/entityfacts/106220063 659
100 200 EF https://hub.culturegraph.org/entityfacts/100001467 600
100 501 EF2SO https://labs.ddb.de/app/ef2so/118505556 719
100 200 EF2SO https://labs.ddb.de/app/ef2so/100000355 752
100 501 EF2SO https://labs.ddb.de/app/ef2so/140585524 854
100 200 EF2SO https://labs.ddb.de/app/ef2so/100001394 777
100 200 EF2SO https://labs.ddb.de/app/ef2so/106220063 736
100 200 EF2SO https://labs.ddb.de/app/ef2so/100000193 775
100 200 EF2SO https://labs.ddb.de/app/ef2so/118540238 673
100 200 EF2SO https://labs.ddb.de/app/ef2so/100054102 736
100 200 EF2SO https://labs.ddb.de/app/ef2so/100025250 768
100 501 EF2SO https://labs.ddb.de/app/ef2so/118577182 811
100 200 EF2SO https://labs.ddb.de/app/ef2so/100001467 725
100 200 EF2SO https://labs.ddb.de/app/ef2so/100014704 861