I have got this script from the Ontotext docs pages working. However, is there any way I can augment the knowledge base with data with my own local graphdb content, not just Wikidata and DBPedia. If I wanted to link to entities of my own specification, can I add my graphdb to the kwowledge base?
Source of script:
https://graphdb.ontotext.com/documentation/10.5/text-mining-plugin.html#what-s-in-this-document
Create a TAG client
PREFIX txtm: <http://www.ontotext.com/textmining#>
PREFIX txtm-inst: <http://www.ontotext.com/textmining/instance#>
INSERT DATA {
txtm-inst:tagService txtm:connect txtm:Ces;
txtm:service "https://tag.ontotext.com/extractor-en/extract" .
}
Find Tag entities through GraphDB
PREFIX txtm: <http://www.ontotext.com/textmining#>
PREFIX txtm-inst: <http://www.ontotext.com/textmining/instance#>
PREFIX pubo: <http://ontology.ontotext.com/publishing#>
SELECT ?annotationText ?annotationType ?annotationStart ?annotationEnd ?feature ?value
WHERE {
?searchDocument a txtm-inst:tagService;
txtm:text '''Dyson Ltd. plans to hire 450 people globally, with
more than half the recruits in its headquarters in Singapore.
The company best known for its vacuum cleaners and hand dryers will add 250 engineers in
the city-state. This comes short before the founder James Dyson announced he is moving
back to the UK after moving residency to Singapore. Dyson, a prominent Brexit supporter
who is worth US$29 billion, faced criticism from British lawmakers for relocating his
company.''' .
graph txtm-inst:tagService {
?annotatedDocument txtm:annotations ?annotation .
?annotation txtm:annotationText ?annotationText ;
txtm:annotationType ?annotationType ;
txtm:annotationStart ?annotationStart ;
txtm:annotationEnd ?annotationEnd ;
{
?annotation txtm:features ?item .
?item ?feature ?value
}
}
}
The example you refer to demonstrates how to integrate an (external to GraphDB) information extraction service via GraphDB's text mining plug-in. In this case it is Ontotext's Tag extraction service, which is part of one of the company's public demonstrators. Its NLP component performs entity linking to Wikidata instances.
Of course, you can write whatever RDF you'd like in a GraphDB instance you have deployed somewhere. The public instance that's serving the demonstrator, however, is not open to the public for writing.
So, in order to do what you are asking, you'd need to import the data you need in a GraphDB instance, deploy or develop a text mining service which is performing the extraction you are interested in and take care of the data synchronization between the knowledge graph and that instance. Then you'd be able to call it over HTTP in the way the example illustrates.
Such kinds of services are what Ontotext also provides in the form of custom solutions.(1)
(1) Disclaimer: I am working for Ontotext, currently leading the solutions unit.