Open ziodave opened 7 years ago
This is a sample SPARQL query to get the Redlink analysis results:
PREFIX mmm: <http://www.mico-project.eu/ns/mmm/2.0/schema#>
PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX fam: <http://vocab.fusepool.info/fam#>
SELECT * WHERE { {
<http://demo2.mico-project.eu:8080/marmotta/de12b016-17d1-4613-85b9-055b797d1fa3> mmm:hasPart [ mmm:hasBody [
a <http://vocab.fusepool.info/fam#LinkedEntity> ;
fam:entity-label ?label ;
fam:entity-reference ?entityReference ;
fam:entity-type ?type ;
fam:confidence ?confidence
] ]
}
UNION
{
<http://demo2.mico-project.eu:8080/marmotta/de12b016-17d1-4613-85b9-055b797d1fa3> mmm:hasPart [ mmm:hasBody [
a <http://vocab.fusepool.info/fam#TopicAnnotation> ;
fam:topic-label ?label ;
fam:topic-reference ?entityReference ;
a ?type ;
fam:confidence ?confidence
] ]
} }
The SPARQL query outputs 4 cols:
In order to store the analysis results we can extend the existing Fragment
abstract class. This class has also information about the start
and end
timecode of the fragment. This information doesn't appear to be readily available, but it might be in the future. So start
/end
will be set to -1
for the time being (the fields aren't nullable).
Since we're going to perform a SPARQL query to get the results, we need a supporting service: QueryService
.
Once we got the JSON response from the query, we need to parse it in order to store entities and topics.
Add support for entity and topic analysis from Redlink.