Skip to content

Latest commit

 

History

History
89 lines (69 loc) · 3.2 KB

File metadata and controls

89 lines (69 loc) · 3.2 KB

NED AGDISTIS

Intention

Receives a textual question and the spots from an NER component, disambiguates the spots and stores the corresponding named entities.

Behavior

As a Qanary component, it reads the question and the annotations produced by upstream components from the Qanary triplestore (the shared process memory), performs its task — disambiguate recognised entity mentions and link them to a knowledge base — and writes the result back as standard Qanary (Web Annotation / qa:) annotations. See Input specification / Output specification below for the exact annotation contract.

Characteristics

  • Task type: Named Entity Disambiguation / Entity Linking (NED).

  • External service: http://139.18.2.164:8080/AGDISTIS

  • Note: Represents a wrapper of the Stanford NER tool used here as a spotter.

  • Offline build: builds and (where present) tests run offline.

Implementation

  • Language: Java (JDK 21).

  • Major frameworks: Spring Boot 3.5 (spring-boot-starter-parent); the Qanary component framework eu.wdaqua.qanary:qa.component 4.0.0 (transitively Spring Boot Admin client + Apache Jena 5); Gson.

  • Main component class: src/main/java/eu/wdaqua/qanary/component/agdistis/ned/Agdistis.java (extends eu.wdaqua.qanary.component.QanaryComponent).

  • Tests: 6 test class(es) under src/test/java/ (AgdistisLiveTest.java, AgdistisMockedTest.java, AgdistisTestConfiguration.java, CacheTests.java, QanaryServiceControllerTests.java, SwaggerUiAvailabilityTest.java).

Build and run

Targets the current Qanary framework 4.0.0 (Spring Boot 3, Java 21). Install the framework first (mvn install in the Qanary repository), then build with JDK 21:

JAVA_HOME=/path/to/jdk21 mvn clean package
docker build --build-arg JAR_FILE=target/qanary-component-ned-agdistis.jar -t qanary/qanary-component-ned-agdistis .

Input specification

@prefix qa: <http://www.wdaqua.eu/qa#> .
@prefix oa: <http://www.w3.org/ns/openannotation/core/> .

<urn:qanary:input> a qa:AnnotationOfSpotInstance .
<urn:qanary:input> oa:hasTarget [
    a    oa:SpecificResource ;
    oa:hasSource  <urn:qanary:myQuestion> ;
    oa:hasSelector  [
        a oa:TextPositionSelector ;
        oa:start "0"^^xsd:nonNegativeInteger ;
        oa:end  "5"^^xsd:nonNegativeInteger .
    ]
] ;

Output specification

Comment: no score in the output

@prefix qa: <http://www.wdaqua.eu/qa#> .
@prefix oa: <http://www.w3.org/ns/openannotation/core/> .

<urn:qanary:output> a qa:AnnotationOfInstance .
<urn:qanary:output> oa:hasTarget [
    a   oa:SpecificResource;
        oa:hasSource    <urn:qanary:myQanaryQuestion> ;
        oa:hasSelector  [
            a oa:TextPositionSelector ;
            oa:start "0"^^xsd:nonNegativeInteger ;
            oa:end  "5"^^xsd:nonNegativeInteger
        ]
    ] .
<urn:qanary:output> oa:hasBody <urn:dbr:Resource> ;
    oa:annotatedBy <http://agdistis.aksw.org> ;
    oa:annotatedAt "2001-10-26T21:32:52"^^xsd:dateTime .