Nice example of what you can do with SPARQL. Model from a Model
<pre class="programlisting">Query query = QueryFactory.create(szQuery) ; QueryExecution qexec = QueryExecutionFactory.create(query, model); Model constructModel = qexec.execConstruct(); System.out.println("Construct result = " + constructModel.toString()); </pre>
The install of Docker Toolbox is simple Unfortunately, either due to late nights, or other, its not clear that you appear to need to start a network to access the Docker instance of MySQL by a Java process running outside of the docker environment. Hence I found the following from web search solved by project:
- docker network create mysqlapp_net
- docker run –name mysqldb –net mysqlapp_net -p 3306:3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -d mysql
Although a few years old, this presentation from a development manager at the British Museum provide some interesting reading.
Which nicely leads to ModelD2RQ:
The ModelD2RQ class provides a Jena Model view on the data in a D2RQ-mapped database.
A nice example of a SPARQL query using the ModelD2RQ engine is shown here. A quick search of the web leads to an interesting discuss using similar code, but around D2RQ and entailment (somewhat dated), showing the usage of ModelFactory.createOntologyModel()
ModelFactory looks like we now have the option to add Reasoner’s between the underlying data source, and the requesting SPARQL. Interesting. I’m guessing the following code would achieve some interesting results:
<pre>final ModelD2RQ m = new ModelD2RQ(<path to mapping.ttl>); final Reasoner reasoner = <some reasoner>; final InfModel ontModel = ModelFactory.createInfModel(reasoner, m); final String sparql = <query> final Query q = QueryFactory.create(sparql); final ResultSet rs = QueryExecutionFactory.create(q, ontModel).execSelect();
I read in CityAM this morning that Accenture is starting an Artifical Intelligence practice. I wonder if that now means that Artificial Intelligence is similar to Big Data – a buzzword that is over hyped, and shouldn’t be used anymore due to the baggage associated with it? It appears focused on virtual agents, which maybe good or bad
to develop go-to-market strategies, solutions and consulting service offerings around deployments of virtual agent technology for clients across several industries with initial focus on banking, insurance and travel.
ModelFactory is the on stop shop for creating Model’s in Apache Jena. ModelFactory is also the way to create Inference models, which offer different kinds of inference over RDF-based models (used for RDFS and OWL) – through reasoners.
One interesting example can be seen here on stackoverflow.
Which does lead back to section 2 and the OpenTox article. Its a shame the article doesn’t go further to show effectively a SPARQL made against a D2RQ data source, but prior to the D2RQ data source being queried, a Reasoner is leveraged to effectively enhance the SPARQL.
Finally, probably worth having a look at these samples around Family Tree.