LDA – Topic Modeling

•May 23, 2016 • Leave a Comment

Interesting read over on databricks with regards usage of MLLib and LDA.  Sample Scala code is available here, and Java sample here.

SPARQL Construct Queries

•May 19, 2016 • Leave a Comment

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());

Docker Toolbox and MySQL

•May 19, 2016 • Leave a Comment

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

Linked Data, Ontologies and Inference

•May 17, 2016 • Leave a Comment

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:

&lt;pre&gt;final ModelD2RQ m = new ModelD2RQ(&lt;path to mapping.ttl&gt;);
final Reasoner reasoner = &lt;some reasoner&gt;;
final InfModel ontModel = ModelFactory.createInfModel(reasoner, m);

final String sparql = &lt;query&gt;

final Query q = QueryFactory.create(sparql);
final ResultSet rs = QueryExecutionFactory.create(q, ontModel).execSelect();

Some code on the web is available here, here, and a FOAF example with reasoner and rule here.

Finally, a more recent blog posting on the topic, and also a reminder that the d2rq language is powerful, and offer the ability to join to yourself – d2rq:alias

Artificial Intelligence – Latest Over Hyped Buzzword?

•May 17, 2016 • Leave a Comment

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 – Inference Model

•May 17, 2016 • Leave a Comment

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.

Jena Programming – Reasoners

•May 16, 2016 • Leave a Comment

The Jena Framework Architecture as shown visually here provides a good high level view of how the Inference API allows reasoners to be leverage of your solution.

Querying/Reasoning with Jena and SPARQL” provides a number of use cases with sample code which is helpful.  There’s also a nice HelloSemanticWeb sample here.


Get every new post delivered to your Inbox.

Join 769 other followers