Reasoning is not happening with BI Server in SQL interface

Hi Team,

We are trying to evaluate BI Server features .

We have enabled it for virtual graphs and able to query the data in SQL interface.

Now, we are trying to analyse the reasoning capabilities that we observed in the SPARQL query with the BI server's SQL interface.

Now we have a movie dataset stored in mongo db rendered as Virtual graphs

Next, we tried it to classify a blockbuster movie with certain range in the ontology

Applying that we are successfully able to get the data in the Sparql query as below

image

We are trying to achieve the same with BI Server's SQL interface with the following mapping

@prefix : <http://abc.com/movies/> .
@prefix stardog: <tag:stardog:api:> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sql: <tag:stardog:api:sql:> .

:MovieTableMapping a sql:TableMapping ;
    sql:tableName "Movies" ;
    sql:class :blockbuster ;
    sql:hasField [
        sql:property :revenuecost ;
        sql:fieldName "revenuecost" ;
        sql:type xsd:long
    ] ,
    [
        sql:property :movietitle ;
        sql:fieldName "movietitle" ;
        sql:type xsd:string 
    ] .

Below is the command that i'm using it to add the above mapping into the db

    stardog data add -g tag:stardog:api:sql:schema canonical_movies cp2.ttl

But i'm unable to see any results

I have set the reasoning_schema to default as highlighted in red in the above image.

Could you pls help us to understand is this possible ?? or any mistakes in the procedure.

Note : It's working for the Virtual Knowledge Graph without reasoning as below

@prefix : <http://abc.com/movies/> .
@prefix stardog: <tag:stardog:api:> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sql: <tag:stardog:api:sql:> .

:MovieTableMapping a sql:TableMapping ;
    sql:tableName "Movies" ;
    sql:class :film ;
    sql:hasField [
        sql:property :revenuecost ;
        sql:fieldName "revenue" ;
        sql:type xsd:integer
    ] ,
    [
        sql:property :imdb_id ;
        sql:fieldName "imdb_id" ;
        sql:type xsd:string
    ] ,
    [
        sql:property :movietitle ;
        sql:fieldName "title" ;
        sql:type xsd:string
    ] ,
        [
        sql:property :budget ;
        sql:fieldName "budget" ;
        sql:type xsd:integer
    ] .

Could you pls help us to understand is this possible to get reasoning in BI server as we get in the Sparql query ?? or any mistakes or additional requirements in the procedure. ?

Made it work by turning on "sameAs" property to "FULL" in DB properties

Is there any way where we can configure set @@reasoning_schema = 'default' used in the sql client in the command line options like we set Stardog DB properties ?

Is setting it as a session variable in the connection string a workable solution?

-Paul

1 Like

You shouldn't have to use sameAs FULL to get reasoning to work.

I was able to set the session variable using the --init-command command-line argument.

tmp $ mysql -h 127.0.0.1 -P 5806 -u admin -p --init-command="set @@reasoning_schema='s1'" movies
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 427
Server version: 5.7.28 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select * from Blockbuster;
+-------------------------------+-----------+
| id                            | boxOffice |
+-------------------------------+-----------+
| http://api.stardog.com/Avatar | 100000000 |
+-------------------------------+-----------+
1 row in set (0.04 sec)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.