LUBM SPARQL query defect - Semantic Tech

Dear friends,
We're doing test the performance of triple load and query in Oracle 11g.
The tool we are using is the LUBM, please refer to: http://swat.cse.lehigh.edu/projects/lubm/
This tool has 14 queries, checking inference and query evaluation speed.
The obviouse defect can be found from the result of 7th SPARQL query.
[query7]
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#>
SELECT ?X ?Y
WHERE {
<http://www.Department0.University0.edu/AssociateProfessor0> ub:teacherOf ?Y .
?Y rdf:type ub:Course .
?X ub:takesCourse ?Y .
?X rdf:type ub:Student
By using Oracle as the triple store, we can only have 20 rows of result for this query.
X
Y
http://www.Department0.University0.edu/GraduateStudent56
http://www.Department0.University0.edu/GraduateCourse13
http://www.Department0.University0.edu/UndergraduateStudent41
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent138
http://www.Department0.University0.edu/Course16
X
Y
http://www.Department0.University0.edu/UndergraduateStudent201
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent184
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent249
http://www.Department0.University0.edu/Course16
X
Y
http://www.Department0.University0.edu/UndergraduateStudent190
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent219
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent161
http://www.Department0.University0.edu/Course16
X
Y
http://www.Department0.University0.edu/UndergraduateStudent1
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent293
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent222
http://www.Department0.University0.edu/Course16
X
Y
http://www.Department0.University0.edu/GraduateStudent70
http://www.Department0.University0.edu/GraduateCourse13
http://www.Department0.University0.edu/UndergraduateStudent306
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent44
http://www.Department0.University0.edu/Course16
X
Y
http://www.Department0.University0.edu/UndergraduateStudent183
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/UndergraduateStudent179
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/GraduateStudent25
http://www.Department0.University0.edu/GraduateCourse12
X
Y
http://www.Department0.University0.edu/UndergraduateStudent155
http://www.Department0.University0.edu/Course16
http://www.Department0.University0.edu/GraduateStudent115
http://www.Department0.University0.edu/GraduateCourse12
20 rows selected.
But in fact, we should have 22 rows of result for this query.
The two rows were not queried out by Oracle are:
X
Y
http://www.Department0.University0.edu/GraduateCourse13
http://www.Department0.University0.edu/GraduateStudent64
http://www.Department0.University0.edu/GraduateCourse13
http://www.Department0.University0.edu/GraduateStudent114     
Actually, when we lookinto the raw data which is loaded into Oracle, these two entities are obviousely here:
1)
<ub:GraduateStudent rdf:about="http://www.Department0.University0.edu/GraduateStudent64">
<ub:name>GraduateStudent64</ub:name>
<ub:memberOf rdf:resource="http://www.Department0.University0.edu" />
<ub:emailAddress>[email protected]</ub:emailAddress>
<ub:telephone>xxx-xxx-xxxx</ub:telephone>
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse37" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse11" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse13" />
<ub:undergraduateDegreeFrom>
<ub:University rdf:about="http://www.University708.edu" /> </ub:undergraduateDegreeFrom>
<ub:advisor rdf:resource="http://www.Department0.University0.edu/AssistantProfessor3" />
</ub:GraduateStudent>
2)
<ub:GraduateStudent rdf:about="http://www.Department0.University0.edu/GraduateStudent114">
<ub:name>GraduateStudent114</ub:name>
<ub:memberOf rdf:resource="http://www.Department0.University0.edu" />
<ub:emailAddress>[email protected]</ub:emailAddress>
<ub:telephone>xxx-xxx-xxxx</ub:telephone>
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse6" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse13" />
<ub:undergraduateDegreeFrom>
<ub:University rdf:about="http://www.University782.edu" /> </ub:undergraduateDegreeFrom>
<ub:advisor rdf:resource="http://www.Department0.University0.edu/FullProfessor3" />
</ub:GraduateStudent>
This kind of defect also happened for 6th query, 8th query and 9th query. Because the output of these queries is too large, so we can't check them manually one by one. (May I don't know there is other way to check the correctness of the result.)
As you can see the above simple query can not give the right answer, we are really doubt the correctness of other queries given by Oracle.
Does anyone could tell me why this happened? Is there any way to fix that?
Many thanks in advance.
Regards,
Bryan

Thanks for you reply Melli.
Yes, we have done inference followed the best practices direction. The data generated by using Jena include the ontology file, please refer to: http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl
The rulebase is OWLPRIME.
If you think the reason is the inference, so I'm curious about why Oracle could find out GraduateStudent70 but can not find out GraduateStudent64?
Do you think is there any differences between entity GraduateStudent64 and entity GraduateStudent70?
They both take course GraduateCourse13 !
GraduateStudent64
<ub:GraduateStudent rdf:about="http://www.Department0.University0.edu/GraduateStudent64">
<ub:name>GraduateStudent64</ub:name>
<ub:memberOf rdf:resource="http://www.Department0.University0.edu" />
<ub:emailAddress>[email protected]</ub:emailAddress>
<ub:telephone>xxx-xxx-xxxx</ub:telephone>
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse37" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse11" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse13" />
<ub:undergraduateDegreeFrom>
<ub:University rdf:about="http://www.University708.edu" /> </ub:undergraduateDegreeFrom>
<ub:advisor rdf:resource="http://www.Department0.University0.edu/AssistantProfessor3" />
</ub:GraduateStudent>
GraduateStudent70
<ub:GraduateStudent rdf:about="http://www.Department0.University0.edu/GraduateStudent70">
<ub:name>GraduateStudent70</ub:name>
<ub:memberOf rdf:resource="http://www.Department0.University0.edu" />
<ub:emailAddress>[email protected]</ub:emailAddress>
<ub:telephone>xxx-xxx-xxxx</ub:telephone>
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse0" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse13" />
<ub:takesCourse rdf:resource="http://www.Department0.University0.edu/GraduateCourse19" />
<ub:undergraduateDegreeFrom>
<ub:University rdf:about="http://www.University5.edu" /> </ub:undergraduateDegreeFrom>
<ub:advisor rdf:resource="http://www.Department0.University0.edu/FullProfessor1" />
</ub:GraduateStudent>
BTW, Today I tried the 6th query which will query all the students exist in the database.
It can not find out GraduateStudent64 as well.
[query6]
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#>
SELECT ?X
WHERE {
?X rdf:type ub:Student
Look forward to your reply.
Regards,
Bryan.

Similar Messages

  • Problems setting up Semantic tech in Orac le 11G  running Linux.

    Hi Every1,
    Am a novice at this Semantic Techno stuff and am trying to overcome that. Am trying to set up an 11G semantic tech baseline on a Linux box and am having difficulties getting everything loaded. Here is where I am at:
    1.     Installed JDK V5.
    2.     Installed Oracle 11Gr2 w/spatial and partitioning.
    3.     Installed Jena V 2.6.2 (jena-2.6.2.zip) IAW Oracle Semantic Technologies Developers guide.
    4.     Installed Jena Adaptor (jena_adaptor_for_release11-2.zip) IAW Oracle Semantic Technologies Developers guide.
    5.     Installed Oracle WebLogic Server 11g Release 1(10.3.1).
    6.     Installed Java 6.1.
    7.     Installed Joseki 3.4.0 IAW Oracle Semantic Technologies Developers guide.
    8.     Created J2EE data source in WebLogic Server admin console IAW Oracle Semantic Technologies Developers guide.
    9.     Completed the autodeploy tasks IAW Oracle Semantic Technologies Developers guide.
    10.     Restarted WebLogic Server.
    11.     Attempted to verify the deployment via web browser (http://localhost.localdomain:7001/joseki) and received an Error 404—Not Found From RFC 2068 message vice the Oracle SPARQL Service Endpoint page as expected.
    Am at a loss … can anyone identify where I went wrong and how to fix this problem?

    Here are the steps I used loading Joseki.
    1. Download and Install Oracle WebLogic Server 11g Release 1 (10.3.1). For details, see http://www.oracle.com/technology/products/weblogic/.
    2. Ensure that you have Java 1.6 installed, because it is required by Joseki 3.4.0.
    3. Download Joseki 3.4.0 (joseki-3.4.0.zip) from http://sourceforge.net/projects/joseki/files/Joseki-SPARQL/.
    4. Unpack joseki-3.4.0.zip into a temporary directory. For example:
    mkdir /tmp/joseki
    cp joseki-3.4.0.zip /tmp/joseki
    cd /tmp/joseki
    unzip joseki-3.4.0.zip
    5. Ensure that you have downloaded and unzipped the Jena Adaptor for Oracle Database, as explained in Section 7.1.
    6. Create a directory named joseki.war at the same level as the jena_adaptor directory, and go to it. For example:
    mkdir /tmp/joseki.war
    cd /tmp/joseki.war
    7. Copy necessary files into the directory created in the preceding step:
    cp /tmp/jena_adaptor/joseki/* /tmp/joseki.war
    cp -rf /tmp/joseki/Joseki-3.4.0/webapps/joseki/StyleSheets /tmp/joseki.war
    8. Create directories and copy necessary files into them, as follows:
    mkdir /tmp/joseki.war/WEB-INF
    cp /tmp/jena_adaptor/web/* /tmp/joseki.war/WEB-INF
    mkdir /tmp/joseki.war/WEB-INF/lib
    cp /tmp/joseki/Joseki-3.4.0/lib/*.jar /tmp/joseki.war/WEB-INF/lib
    cp /tmp/jena_adaptor/jar/*.jar /tmp/joseki.war/WEB-INF/lib
    cp $ORACLE_HOME/md/jlib/sdordf.jar /tmp/joseki.war/WEB-INF/lib
    cp $ORACLE_HOME/jdbc/lib/ojdbc6.jar /tmp/joseki.war/WEB-INF/lib
    Note that in the last command, you can specify ojdbc6.jar instead of ojdbc5.jar if you are using JDK 6.
    9. Using the WebLogic Server Administration console, create a J2EE data source named OracleSemDS. During the data source creation, you can specify a user and password for the database schema that contains the relevant semantic data against which SPARQL queries are to be executed.
    If you need help in creating this data source, see Section 7.2.1, "Creating the
    Required Data Source Using WebLogic Server".
    7.2.1 Creating the Required Data Source Using WebLogic Server
    If you need help creating the required J2EE data source using the WebLogic Server admin console, you can follow these steps:
    1. Login to: http://<hostname>:7001/console
    2. In the Domain Structure panel, click Services.
    3. Click JDBC
    4. Click Data Services.
    5. In the Summary of JDBC Data Sources panel, click New under the Data Sources table.
    6. In the Create a New JDBC Data Source panel, enter or select the following values.
    Name: OracleSemDS
    JNDI Name: OracleSemDS
    Database Type: Oracle
    Database Driver: Oracle's Driver (Thin) For Instance Connections Versions: 9.0.1,9.2.0,10,11
    7. Click Next twice.
    8. In the Connection Properties panel, enter the appropriate values for the Database Name, Host Name, Port, Database User Name (schema that contains semantic data), Password fields.
    DATABASE NAME: orcl
    HOST NAME: orcl.localdomain
    PORT: 1521
    DATABASE USWER NAME: nciuser
    PASSWORD: <password>
    CONFIRM PASSWORD: <password>
    9. Click Next.
    10. Select (check) the target server or servers) to which you want to deploy this OracleSemDS data source.
    11. Click Finish.
    You should see a message that all changes have been activated and no restart is necessary.
    10. Go to the autodeploy directory of WebLogic Server and copy files, as follows.(For information about auto-deploying applications in development domains, see: http://download.oracle.com/docs/cd/E11035_01/wls100/deployment/autodeploy.html)
    cd <domain_name>/autodeploy
    cp -rf /tmp/joseki.war <domain_name>/autodeploy
    In the preceding example, <domain_name> is the name of a WebLogic Server domain.
    Note that while you can run a WebLogic Server domain in two different modes, development and production, only development mode allows you use the auto-deployment feature.
    11. Check the files and the directory structure, as in the following example:
    autodeploy/% ls -1R ./joseki.war/
    ./joseki.war:
    application.xml
    index.html
    joseki-config.ttl
    StyleSheets/
    update.html
    WEB-INF/
    xml-to-html.xsl
    ./joseki.war/StyleSheets:
    joseki.css
    ./joseki.war/WEB-INF:
    lib/
    web.xml
    ./joseki.war/WEB-INF/lib:
    arq-2.8.0.jar
    arq-2.8.0-tests.jar
    icu4j-3.4.4.jar
    iri-0.7.jar
    jena-2.6.2.jar
    jenatest-2.6.2.jar
    jetty-6.1.10.jar
    jetty-util-6.1.10.jar
    joseki-3.4.0.jar
    junit-4.5.jar
    log4j-1.2.12.jar
    lucene-core-2.3.1.jar
    ojdbc5.jar
    sdordfclient.jar
    sdordf.jar
    servlet-api-2.5-6.1.10.jar
    servlet-api-2.5.jar
    slf4j-api-1.5.6.jar
    slf4j-log4j12-1.5.6.jar
    stax-api-1.0.1.jar
    wstx-asl-3.2.9.jar
    xercesImpl-2.7.1.jar
    12. Start or restart WebLogic Server.
    13. Verify your deployment by using your Web browser to connect to a URL in the following format (assume that the Web application is deployed at port 7001): http://<hostname>:7001/joseki
    You should see a page titled Oracle SPARQL Service Endpoint using Joseki, and the first text box should contain an example SPARQL query.
    This is where I got the http error message instead of the Oracle SPARQL Service Endpoint using Joseki screen.

  • Running a SPARQL query across all models

    Is there a concise way of running a SPARQL query against all models in the database (or at least all models owned by a db user) via the Oracle Jena Adapter? Do I have to manually find all models, add them to a GraphOracleSem, and pass a composite model (from the graph) to a QueryFactory.create() method or is there a simpler way like something synonymous to DatasetStore.create() that would pass back the entire dataset?
    Thanks

    I want to run the query against a merged graph of all the models.
    I see you can do this by attaching an Attachment containing the list of all model names to a graph. I could be dealing with several models. I really want to be able to query against the entire data set but this mean I must know the names of all the models (which means selecting from MDSYS>RDF_MODEL$). Here is the code I came up with. This gives me a Dataset that I can then pass to QueryExecutionFactory.create(Query, Dataset). Any suggestions?
    private static final String SELECT_MODELS =
    "SELECT model_name FROM MDSYS.RDF_MODEL$ WHERE owner=? and model_name != ?";
    private static final String MODEL_NAME = "model_name";
    * The name of a reserved model representing all semantic data in the database.
    private static final String DATASET_MODEL_NAME = "DATASET";
    public Dataset getDataSet() {
    Dataset ds = null;
    Oracle oracle = getOracle();
    // The hard way: manually
    try {
    // Get all accessible models in the store
    PreparedStatement stmt = oracle.getConnection().prepareStatement(SELECT_MODELS);
    stmt.setString(1, oracle.getConnection().getUserName());
    stmt.setString(2, DATASET_MODEL_NAME);
    ResultSet rs = stmt.executeQuery();
    // Add them to a composite model                    
    List<String> modelNames = new ArrayList<String>();
    while ( rs.next() ) {
    modelNames.add(rs.getString(MODEL_NAME));          
    stmt.close();
    // create a dataset from the composite model
    Attachment attachment = Attachment.createInstance(
    (String[])modelNames.toArray(new String[0]),
    new String[0],
    InferenceMaintenanceMode.NO_UPDATE,
    QueryOptions.QUERY_VALID_ONLY );
    GraphOracleSem graph = new GraphOracleSem( oracle,
    DATASET_MODEL_NAME, attachment );
    ds = DatasetFactory.create(new ModelCom(graph));
    } catch (SQLException e) {
    log.warn("SQL Exception caught", e);               
    } catch (Exception e) {
    log.warn("Exception thrown.", e);
    return ds;
    Thanks!

  • Single quote in SPARQL query

    Hi,
    I have a SPARQL query with a clause like (?affy gb:bioprocess "3\'-phosphoadenosine" .). Oracle Jena adapter translates it into
    sdo_rdf_match('(?affy <gb#bioprocess> "3\'||chr(39)||'-phosphoadenosine")..., which throws the following error when executing the query:
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception: oracle.spatial.rdf.server.TokenMgrError: Lexical error at line 1, column 50. Encountered: "\'" (39), after : "\"3\\"
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 169
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 35
    ORA-06512: at line 4
    What does Oracle Jena adapter expect if the SPARQL query has single quote in the literal value? Thanks,
    Weihua

    Hi,
    What is your database version?
    Could you list exactly the literal value you want to query? Please ignore any escapes. Is it as follows?
    3'-phosphoadenosine
    Thanks,
    Zhe

  • Maximum Size of bind variables/model names in a SPARQL query

    I was wondering what the maximum field size is for a bind variable (?'' being used in the subject or object within a triple) in a SPARQL query using the Jena Adapter for Oracle? The reason for this is that I keep getting Oracle exception (ORA-00972: identifier is too long) when executing queries.
    The other question dealt with the max size of the model names? Is there anyway to increase this length by extending certain classes within the Jena Adapter for Oracle?
    Thanks,
    Rahul

    Hi,
    For model names, because we use model names together with some suffixes to create namespace tables, application tables, and indexes, the length
    has to be shorter than 30 bytes - 11 bytes = 19 bytes.
    Note that 30 bytes limit is imposed by Oracle database. You cannot create a table with a name longer than 30 bytes.
    11 bytes is the maximum suffix length imposed by Jena Adapter. We are considering to reduce it to 4 for the next Jena Adapter release.
    For variable names, because we translate SPARQL to SQL queries (and variable name to column alias), there is the same 30 bytes limit.
    Note that there are suffixes for variable names as well. For example, $RDFVID, $RDFLTYP, ... These suffixes are used internally.
    Some simple tests for illustration purpose.
    SQL> create table a23456789012345678901234567890(i int);
    Table created.
    SQL> create table a234567890123456789012345678901(i int);
    create table a234567890123456789012345678901(i int)
    ERROR at line 1:
    ORA-00972: identifier is too long
    -- Assume table X has a column I
    SQL> select i as "v23456789012345678901234567890" from x;
    no rows selected
    SQL> select i as "v234567890123456789012345678901" from x;
    select i as "v234567890123456789012345678901" from x
    ERROR at line 1:
    ORA-00972: identifier is too long
    Hope it helps,
    Zhe Wu

  • SPARQL query through Jena adaptor not work when string literals used

    Hi,
    When I executed the following SPARQL query through Oracle Jena adaptor:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName ?name . }
    I got the expected results.
    However it won't return anything when I narrowed the query to match a particular name like below:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName \"Julie\" . }
    I also tried the Filter approach:
    SELECT ?personHasFirstName WHERE {?personHasFirstName foaf:firstName ?name . FILTER (?name =\"Julie\") }
    It still doesn't return any results.
    I saw from the release notes about the bug dealing with "\". My guess is that the above behavior is caused by that bug. What is the suggested way to walk-around this? Thanks,
    Weihua

    Could you please try this? It works as expected on my machine.
    GraphOracleSem graph = new GraphOracleSem( oracle, modelName);
    ModelOracleSem model = new ModelOracleSem(graph);
    Node sub = Node.createURI("http://test.com/employee123");
    Node pre = Node.createURI("http://xmlns.com/foaf/0.1/firstName");
    Node obj = Node.createLiteral("Julie");
    graph.add(Triple.create(sub, pre, obj));
    String queryString =
    " PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
    "SELECT ?person WHERE { ?person foaf:firstName \"Julie\" . } ";
    QueryExecution qexec = QueryExecutionFactory.create(
    QueryFactory.create(queryString), model);
    try {
    ResultSet results = qexec.execSelect();
    while (results.hasNext()) {
    QuerySolution soln = results.nextSolution();
    psOut.println("runQuery: soln " + soln);
    finally {
    if (qexec != null)
    qexec.close();
    output snippet:
    runQuery: soln ( ?person = <http://test.com/employee123> )

  • Sparql query using variable paths

    Hi,
    I have a following graph in Oracle that I like to query using Jena 2.6.4 and OracleJenaAdaptor 11.2.0.3
    ind:123 :hasA ind:124
    ind:124 :hasB ind:125
    ind:125 :hasC ind:126
    ind:123 :hasD ind:127
    Is there a way to construct a sparql query to return all ind: without "hard-conding" the full property name? Something in these lines (note, this query doesn't really work).
    select *
    where { ind:123 (:has*)+ ?x }
    Thanks.

    :hasA rdf:type owl:ObjectProperty ;
    rdfs:subPropertyOf :hasRelation .
    :hasB rdf:type owl:ObjectProperty ;
    rdfs:subPropertyOf :hasRelation .
    :hasC rdf:type owl:ObjectProperty ;
    rdfs:subPropertyOf :hasRelation .
    :hasD rdf:type owl:ObjectProperty ;
    rdfs:subPropertyOf :hasRelation .
    String q1 = "SELECT ?x, ?y
    where {?x (:hasRelation)+ ?y} ";
    Stirng q2 = "SELECT ?x, ?y
    where {?x :hasRelation ?y} ";
    Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
    Attachment attachment = Attachment.createInstance(new String[]{"my_asset","my_model"},
    new String[]{"OWLPRIME"}, InferenceMaintenanceMode.UPDATE_WHEN_COMMIT, QueryOptions.ALLOW_QUERY_INVALID_AND_DUP);
    GraphOracleSem graph = new GraphOracleSem(oracle, "vm_model", attachment);
    ModelOracleSem inferencedModel = new ModelOracleSem(graph);
    Query query = QueryFactory.create(q1);
    Edited by: a1239090 on Aug 15, 2012 4:54 PM

  • SPARQL query with OPTIONAL

    Hi,
    When I run a SPARQL query with OPTIONAL in the WHERE clause, I saw a lot of "select 1 from ***" kind of queries got executed. The query runs very slow. I'm running Jena adaptor 2 against Oracle 11.1.0.6. We have about half million triples in the model. The queries we need to run tend to be complex and they run pretty slow. Does Oracle 11.1.0.7 have big query performance improvement over 11.1.0.6? Is there anything that we can do on the application side or on the database side to boost the query performance? Thanks,
    Weihua

    Native database support for OPTIONAL in SEM_MATCH based RDF query has been made available via patch 7600122 on 11.1.0.7. Direct use of SEM_MATCH to query your data from SQL has significant performance benefits.

  • SPARQL query to query an ontology using JENA

    Hello,
    I'm trying to query my OWL ontology.
    This is an example of my ontology:
        <owl:Class rdf:about="#escherichia_coli">
            <owl:equivalentClass>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="#has_genus"/>
                    <owl:someValuesFrom rdf:resource="#escherichia_genus"/>
                </owl:Restriction>
            </owl:equivalentClass>
            <rdfs:subClassOf rdf:resource="#named_bacteria"/>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="#has_respiratory_mode"/>
                    <owl:someValuesFrom rdf:resource="#Aerobes"/>
                </owl:Restriction>
            </rdfs:subClassOf>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="#hasGramStaining"/>
                    <owl:someValuesFrom rdf:resource="#gram_staining_negative"/>
                </owl:Restriction>
            </rdfs:subClassOf>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="#has_morphology"/>
                    <owl:someValuesFrom rdf:resource="#rod"/>
                </owl:Restriction>
            </rdfs:subClassOf>
        </owl:Class>I would like to retrieve all bacterium caracteristics (morphology, gram_staning, respiratory_mode).
    Whith this query, i can show the bacteria list.
    PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX :            <http://www.ontology.com/bacteria.owl#>
    PREFIX owl:      <http://www.w3.org/2002/07/owl#>
    SELECT DISTINCT *
    WHERE {
         ?bacteria rdfs:subClassOf :named_bacteria.
         FILTER (isIRI(?bacteria) && !sameTerm(?bacteria, owl:Nothing))
    ORDER BY (?bacteria)With this query, i tried to have all caracteristics, but it doesn't work (i also used the UNION clause, but it doesn't work to):
    SELECT DISTINCT ?bacteria ?genus
    WHERE  {
           ?bacteria rdfs:subClassOf :named_bacteria;
                     :has_genus ?genus.
         ?genus    rdfs:subClassOf :genus;
         FILTER (isIRI(?bacteria) && !sameTerm(?bacteria, owl:Nothing))
    } ORDER BY (?bacteria)My second question is how to use query 2 graph with JENA? I've a .java file in wich i used some JENA properties to query an OWL file (i open my owl file and my .rq file with the SPARQL query in my .java File). But i need to query also a .n3 File, is it possible to do this only in my SPARQL query?
    Please, i really need your help!
    Kind regards

    One thing to clarify, are you using just Jena or are you using Jena + Jena Adaptor + Oracle database?
    Thanks,
    Zhe Wu

  • Error message to the launch of a SPARQL query well trained in Java

    Hello, I am not if it is a compatibility problem between JENA ARQ and got the message that I sometimes not consistently (at least I can not reproduce !!!) so it is very difficult to correct at least to understand and find a solution? (Anyone have a suggestion or solution)
    Error message:
    --- exec-maven-plugin:1.2.1:exec (default-cli) @ MIDA ---
    Oct 13, 2014 21:01:21 PM ca.ireq.oracle12c.connect.OracleThin <init>
    INFO: Connection try ... : jdbc:oracle:thin:@liost:1521:LIOST with user *****
    Exception in thread "main" java.lang.NoSuchMethodError: com.hp.hpl.jena.sparql.algebra.optimize.TransformJoinStrategy: method <init>()V not found
    at oracle.spatial.rdf.client.jena.OptimizeSem.rewrite(OptimizeSem.java:124)
    at oracle.spatial.rdf.client.jena.OptimizeSem.optimize(OptimizeSem.java:91)
    at oracle.spatial.rdf.client.jena.QueryEngineSem.modifyOp(QueryEngineSem.java:195)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:104)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:97)
    at oracle.spatial.rdf.client.jena.QueryEngineSem$1.create(QueryEngineSem.java:211)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:426)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:400)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:408)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:135)
    at date.app.AppendLabel.query(AppendLabel.java:76)
    at date.app.AppendLabel.main(AppendLabel.java:50)
    BUILD FAILURE
    Total time: 32.564s
    Finished at: Fri Oct 13 21:01:45 EDT 2014
    Final Memory: 5M/123M
    big thank you in advance.

    Allo I use Maven to execute my Project java :
            <dependency>
                <groupId>com.hp.hpl.jena</groupId>
                <artifactId>jena</artifactId>
                <version>2.6.4</version>
            </dependency>
            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc7</artifactId>
                <version>12.1.0.1</version>
            </dependency>
            <dependency>
                <groupId>com.hp.hpl.jena</groupId>
                <artifactId>arq</artifactId>
                <version>2.8.8</version>
            </dependency>
    I find no maven repository with Oracle Jena 2.7.2 and with under dependency?

  • WITH CLAUSE in SPARQL - Running SPARQL query using JENA

    Hi,
    Can anybody help me how to use WITH Clause in SPARQL. Below is my Query. I am using Jena 2.6.3 to Run my Query.
    "PREFIX assc: <http://www./.../> " +
    "WITH " +
         "( " +
                        " select ?associate" +
                        " where {?associate assc:belongsTo <http://www./../Relationship>} " +
                        " AS :associateList" +
         " )" +
                   " select ?client ?associate " +
                   " where { ?client assc:Sees ?associate . ?associate assc:belongsTo <http://www./../Relationship> ." +
                   " :associateList(?associate) }" ;
    Thanks and Regards,
    Manish Hardasmalani

    Hi Zhe,
    Actually i am looking for example say,
    I have a select query where i get id , name and mark this output as a relationshipName
    And then use this relationshipName as a function in second select query.
    Example:
    WITH
    SELECT ... WHERE {...} AS relationName
    SELECT ... FROM <graph> where {... :relationName(...) [FILTER(...)]}
    In the above pseudo code relationName is populated in first select and used in second select. I am searching something similar to this.

  • How to create a normal view from the RDF sparql query?

    Hi,
    I am trying to create a view from the below query.
    select id, name from table(SEM_MATCH('
    (?id rdf:type dm:Conceptual_SMA_Information_Group)
    (?id dm:hasConceptualSmaInformationGroupName ?name)',
    SEM_Models('nyc_sma_curr'), null,
    SEM_ALIASES(SEM_ALIAS('dm','http://www.cdse.com/sbip/dwh/mdm/data_modeling#')), null))
    order by name,id;
    I am trying the below syntax to create a viewa but its giving the error and m unable to create view.
    create view Information_Group as
    select id, name from table(SEM_MATCH('
    (?id rdf:type dm:Conceptual_SMA_Information_Group)
    (?id dm:hasConceptualSmaInformationGroupName ?name)',
    SEM_Models('nyc_sma_curr'), null,
    SEM_ALIASES(SEM_ALIAS('dm','http://www.cdse.com/sbip/dwh/mdm/data_modeling#')), null))
    order by name,id;
    Error: ORA-00600: internal error code, arguments: [17046], [0x46E62D720], [0x46F2485F0], [1], [], [], [], [], [], [], [], []
    Please help me to create a view.
    Let me know if you need more details.
    Regards,
    Kavitha.

    Hi,
    This is a known issue in 11.1 (RDBMS Bug 6688356).
    Please contact Oracle Support to get the patch for this bug. Alternatively, you can upgrade to release 11.2.
    Thanks,
    Matt

  • Oracle semantic tech inference + Protege plugin

    Hi
    From the Protege Plugin, I've installed a simple Ontology for testing on Oracle 11g, I've added a few individuals to the database with no problem at all, though I can't see the inference on the database!!.
    Jena Adapter for Oracle Database I am using these instructions to install Joseki and a Java client. Everything seems okay, I can query the RDF database and the individuals using Joseki and a Jena client.
    This snippet is part of the client to perform the inference.
    Oracle oracle = new Oracle("jdbc:oracle:thin:@161.x.y.z:1521:NTCSHIST", "user", "password");
            Attachment attachment = Attachment.createInstance(new String[] {}, "OWLPRIME",
                        InferenceMaintenanceMode.NO_UPDATE, QueryOptions.DEFAULT);
            final GraphOracleSem graph = new GraphOracleSem(oracle, "M_NAMED_GRAPHS", attachment);
            System.out.println("Analyzing db...");
            graph.analyze();
            System.out.println("Infering db...");
            graph.performInference();
    After running this code the database it seems inferred, but when I query it, it looks to me the data wasn't inferred.
    Does anyone have any clue to see how to infer data on Oracle?. Maybe I doing something wrong or I misunderstood something because I got empty response when I query for data that it should be inferred. The ontology should be okay, because when i create individuals on Protege and run the reasoner, the inferred data shows up perfectly.
    Cheers

    <?xml version="1.0"?>
    <!DOCTYPE rdf:RDF [
        <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
        <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
        <!ENTITY geosparql "http://www.opengis.net/ont/geosparql#" >
        <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
        <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
        <!ENTITY starguidecatalog "http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#" >
    ]>
    <rdf:RDF xmlns="http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#"
        xml:base="http://www.tng.iac.es/ontologies/2014/6/starguidecatalog"
        xmlns:geosparql="http://www.opengis.net/ont/geosparql#"
        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
        xmlns:owl="http://www.w3.org/2002/07/owl#"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:starguidecatalog="http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#">
        <owl:Ontology rdf:about="http://www.tng.iac.es/ontologies/2014/6/starguidecatalog">
            <owl:imports rdf:resource="http://www.opengis.net/ont/geosparql"/>
            <owl:imports rdf:resource="http://www.opengis.net/ont/sf"/>
        </owl:Ontology>
        <!--
        // Object Properties
        -->
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#border -->
        <owl:ObjectProperty rdf:about="&starguidecatalog;border">
            <rdf:type rdf:resource="&owl;SymmetricProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;Tile"/>
            <rdfs:range rdf:resource="&starguidecatalog;Tile"/>
            <owl:inverseOf rdf:resource="&starguidecatalog;border"/>
        </owl:ObjectProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#hasPointGeometry -->
        <owl:ObjectProperty rdf:about="&starguidecatalog;hasPointGeometry">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:subPropertyOf rdf:resource="&geosparql;hasGeometry"/>
            <rdfs:range rdf:resource="http://www.opengis.net/ont/sf#Point"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
        </owl:ObjectProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#insideOf -->
        <owl:ObjectProperty rdf:about="&starguidecatalog;insideOf">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:range rdf:resource="&starguidecatalog;Tile"/>
        </owl:ObjectProperty>
        <!--
        // Data properties
        -->
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#astroClass -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;astroClass">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;targetInfo"/>
            <rdfs:range rdf:resource="&xsd;float"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#coordinates -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;coordinates">
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;targetInfo"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#dec -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;dec">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;coordinates"/>
            <rdfs:range rdf:resource="&xsd;float"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#epoch -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;epoch">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;targetInfo"/>
            <rdfs:range rdf:resource="&xsd;integer"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#f -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;f">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;magnitude"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#id -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;id">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;targetInfo"/>
            <rdfs:range rdf:resource="&xsd;integer"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#j -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;j">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;magnitude"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#magnitude -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;magnitude">
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;targetInfo"/>
            <rdfs:range rdf:resource="&xsd;float"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#n -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;n">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;magnitude"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#ra -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;ra">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:domain rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;coordinates"/>
            <rdfs:range rdf:resource="&xsd;float"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#targetInfo -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;targetInfo">
            <owl:propertyDisjointWith rdf:resource="&starguidecatalog;tileInfo"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#tileInfo -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;tileInfo">
            <rdfs:domain rdf:resource="&starguidecatalog;Tile"/>
            <rdfs:range rdf:resource="&xsd;float"/>
        </owl:DatatypeProperty>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#v -->
        <owl:DatatypeProperty rdf:about="&starguidecatalog;v">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <rdfs:subPropertyOf rdf:resource="&starguidecatalog;magnitude"/>
        </owl:DatatypeProperty>
        <!--
        // Classes
        -->
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#AstronomicalCoordinate -->
        <owl:Class rdf:about="&starguidecatalog;AstronomicalCoordinate">
            <rdfs:subClassOf rdf:resource="http://www.opengis.net/ont/sf#Point"/>
            <rdfs:subClassOf rdf:resource="&starguidecatalog;Sky"/>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&starguidecatalog;hasPointGeometry"/>
                    <owl:allValuesFrom rdf:resource="http://www.opengis.net/ont/sf#Point"/>
                </owl:Restriction>
            </rdfs:subClassOf>
        </owl:Class>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#AstronomicalObject -->
        <owl:Class rdf:about="&starguidecatalog;AstronomicalObject">
            <owl:equivalentClass>
                <owl:Class>
                    <owl:unionOf rdf:parseType="Collection">
                        <rdf:Description rdf:about="&starguidecatalog;Galaxy"/>
                        <rdf:Description rdf:about="&starguidecatalog;Star"/>
                        <rdf:Description rdf:about="&starguidecatalog;Supernova"/>
                    </owl:unionOf>
                </owl:Class>
            </owl:equivalentClass>
            <rdfs:subClassOf rdf:resource="&starguidecatalog;Sky"/>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&starguidecatalog;hasPointGeometry"/>
                    <owl:allValuesFrom rdf:resource="http://www.opengis.net/ont/sf#Point"/>
                </owl:Restriction>
            </rdfs:subClassOf>
        </owl:Class>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#Galaxy -->
        <owl:Class rdf:about="&starguidecatalog;Galaxy">
            <owl:equivalentClass>
                <owl:Class>
                    <owl:intersectionOf rdf:parseType="Collection">
                        <rdf:Description rdf:about="&starguidecatalog;AstronomicalObject"/>
                        <owl:Restriction>
                            <owl:onProperty rdf:resource="&starguidecatalog;astroClass"/>
                            <owl:hasValue rdf:datatype="&xsd;float">3.0</owl:hasValue>
                        </owl:Restriction>
                    </owl:intersectionOf>
                </owl:Class>
            </owl:equivalentClass>
            <rdfs:subClassOf rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&starguidecatalog;border"/>
                    <owl:allValuesFrom rdf:resource="&starguidecatalog;Tile"/>
                </owl:Restriction>
            </rdfs:subClassOf>
            <owl:disjointWith rdf:resource="&starguidecatalog;Star"/>
            <owl:disjointWith rdf:resource="&starguidecatalog;Supernova"/>
        </owl:Class>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#Sky -->
        <owl:Class rdf:about="&starguidecatalog;Sky"/>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#Star -->
        <owl:Class rdf:about="&starguidecatalog;Star">
            <owl:equivalentClass>
                <owl:Class>
                    <owl:intersectionOf rdf:parseType="Collection">
                        <rdf:Description rdf:about="&starguidecatalog;AstronomicalObject"/>
                        <owl:Restriction>
                            <owl:onProperty rdf:resource="&starguidecatalog;astroClass"/>
                            <owl:hasValue rdf:datatype="&xsd;float">2.0</owl:hasValue>
                        </owl:Restriction>
                    </owl:intersectionOf>
                </owl:Class>
            </owl:equivalentClass>
            <rdfs:subClassOf rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&starguidecatalog;border"/>
                    <owl:allValuesFrom rdf:resource="&starguidecatalog;Tile"/>
                </owl:Restriction>
            </rdfs:subClassOf>
            <owl:disjointWith rdf:resource="&starguidecatalog;Supernova"/>
        </owl:Class>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#Supernova -->
        <owl:Class rdf:about="&starguidecatalog;Supernova">
            <owl:equivalentClass>
                <owl:Class>
                    <owl:intersectionOf rdf:parseType="Collection">
                        <rdf:Description rdf:about="&starguidecatalog;AstronomicalObject"/>
                        <owl:Restriction>
                            <owl:onProperty rdf:resource="&starguidecatalog;astroClass"/>
                            <owl:hasValue rdf:datatype="&xsd;float">1.0</owl:hasValue>
                        </owl:Restriction>
                    </owl:intersectionOf>
                </owl:Class>
            </owl:equivalentClass>
            <rdfs:subClassOf rdf:resource="&starguidecatalog;AstronomicalObject"/>
            <rdfs:subClassOf>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&starguidecatalog;border"/>
                    <owl:allValuesFrom rdf:resource="&starguidecatalog;Tile"/>
                </owl:Restriction>
            </rdfs:subClassOf>
        </owl:Class>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#Tile -->
        <owl:Class rdf:about="&starguidecatalog;Tile">
            <rdfs:subClassOf rdf:resource="http://www.opengis.net/ont/sf#Polygon"/>
            <rdfs:subClassOf rdf:resource="&starguidecatalog;Sky"/>
        </owl:Class>
        <!--
        // Individuals
        -->
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#Sun -->
        <owl:NamedIndividual rdf:about="&starguidecatalog;Sun">
            <rdf:type rdf:resource="&starguidecatalog;Star"/>
            <dec rdf:datatype="&xsd;float">0.773</dec>
            <ra rdf:datatype="&xsd;float">1.0</ra>
            <astroClass rdf:datatype="&xsd;float">2.0</astroClass>
            <hasPointGeometry rdf:resource="&starguidecatalog;SunCoordinates"/>
        </owl:NamedIndividual>
        <!-- http://www.tng.iac.es/ontologies/2014/6/starguidecatalog#SunCoordinates -->
        <owl:NamedIndividual rdf:about="&starguidecatalog;SunCoordinates">
            <rdf:type rdf:resource="&starguidecatalog;AstronomicalCoordinate"/>
            <geosparql:asWKT rdf:datatype="&geosparql;wktLiteral">Point(12.0 13.3)</geosparql:asWKT>
        </owl:NamedIndividual>
    </rdf:RDF>
    <!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->
    Please note this is a scenario for testing proposes only. It's not meant to be a real scenario !
    Cheers

  • Query IDs in ORACLE_SEM_FS_NS : 32 or 64 bits?

    Hi,
    I have a question regarding query IDs used in ORACLE_SEM_FS_NS prefix definition and in Joseki / Oracle querymgt servlet.
    It seems that :
    * ORACLE_ORARDF_QUERY_MGT_TAB table apparently can hold longs
    * the querymgt servlet accepts longs and returns "No valid query ID specified." for anything over 64 bits.
    * running queries with long qid (either from a Joseki endpoint or from Jena) results in weird behaviour :
    ** qid < 2^32 : OK
    ** qid < 2^64 : returns either an exception (see below) or an empty result set immediately (with no exception)
    ** qid > 2^64 : query runs OK but qid cannot be used to stop query since it is over 64 bits
    Here is the exception shown if you use a qid between 32 and 64 bits :
    Exception in thread "AWT-EventQueue-0"
    java.lang.NumberFormatException: For input string: "8947349906"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:459)
    at java.lang.Integer.parseInt(Integer.java:497)
    at oracle.spatial.rdf.client.jena.OracleQueryContextParameters.getQID(OracleQueryContextParameters.java:83)
    My question: due to the discrepancies when using large values, I do not exactly understand : are the query ids meant to be 32 or 64 bits ? Moreover: I haven't checked whether the id was signed or unsigned. Could you please specify exactly the range of possible values that qid can be assigned ?
    Thanks
    Regards,
    Julien

    Hi Julien,
    My comments are inline.
    Cheers,
    Vlad
    Well, to be honest, I cannot reproduce the issue I faced yesterday. The weblogic server providing Joseki was overloaded for some other reason (out of memory) and was only responding to querymgt queries (the SPARQL queries themselves were stuck threads).
    Regarding the 4th point of your explanation : When you say that "the Jena Adapter" polls the DB regularly to check if any query needs to be killed, do you mean that the following would work ?
    Example : A user runs a SPARQL query via a load balancer that uses two instances of Joseki w/ querymgt. The same user then wants to kill the same long-running query via the same load balancer and hits the other instance of Joseki w/ querymgt.
    V: The two instances of Joseki are using the same datasource right? In that case, the kill request will be sent to both Joseki instances.
    If I understood what you said, the query management features are only available for queries ran through Joseki since they are stopped on the client side. In that case, is there a way to stop long-running queries that are sent directly through JDBC (using Jena adapter) ?
    V: If you submit a SPARQL query programmatically through the Jena Adapter against an Oracle-backed GraphOracleSem, and you specify a QID in the prefix, then the query is registered and you will still be able to kill it using the querymgt servlet. Let me know if this answered your question.
    Regarding the first question (available values for qid), do you plan to fix the fact that only less than half of all 32-bit values are available ? I am asking this because it is quite common to use 32-bit (or multiples of 32 anyway) IDs for instances / sessions of client applications and it seems to me that it would make it easier to use query IDs.
    V: We will look into allowing 64-bit query IDs in the next Jena Adapter release.

  • How to Query serial numbers on VXI smip modules.

    I'm trying to write a program in C# that will query the VXI SMIP Switch Modules for their serial numbers.  Right now I am able to view all the serial numbers through the soft front panel provided with the drivers but I need to automate this process and extract the serial numbers for further processing so I need to access the modules directly and read the data.
    My current  Setup:
    [Computer with PCI-MXI-2 Board] ------> [ Racal Chassis  with  "SM1000E double wide Carrier" that can hold 6 VXI SMIP switch module plugin cards]
    I'm able to see all resources in NI MAX.
    The VXI resource is shown in NI MAX as : VXI0::26::INSTR
    The VXI SM1000E Carrier that holds the 6 plugin module has logical address 26
    and there are 6 modules in there carrier that is 0 based, module 1 is 0, module 2, is 1, module 3, is 2 and so on...
    To my understanding, Visual Studio can automatically create wrapper code using the "Driver Wrapper Wizard" included with the T&M ToolKit.  And by doing this I was able to access some of the functions of the drivers associated with this module.
    I'm trying to use the vtvmSmip_QuerySmip function, which will return the NonVol data for up to six plug-in cards at once according to the documentation in the driver header file.  The definition of the SMiP NonVol structure can be found in the vtvmSmip.h file. But I'm still unsure how to use it.
    Using Visual Studio 2003, the function is available but it requires some arguments.
    Below is the wrapper code generated.
    [code]
    private void button1_Click(object sender, System.EventArgs e)
     // This code creates and initializes an instance of the VXIplug&play wrapper class
     // TODO:  Insert your appropriate values for address, idQuery etc.
     Agilent.TMFramework.InstrumentDriverInterop.Vxipn​pWrappers.VtvmSmip myVtvmSmip;
     myVtvmSmip = new Agilent.TMFramework.InstrumentDriverInterop.Vxipnp​Wrappers.VtvmSmip("GPIB0::7::INSTR", true, true);
     // TODO:  Add your code here.  For example:
     // myVtvmSmip.Reset();
    [code end]
    I was wondering if, I want to use myvtvmSmip.QuerySmip();  What should I pass in as the arguments?  This fuction suppose to return all 6 modules information. not sure how...
    Its definition is as follows:
    void VtvmSmip.QuerySmip(int smipStruct)
    "smipStruct points to the locaton where the data is to be sotred.  The Structure is of type vtvmSmip_SMIP_TYPE.  Look in vtSmipDefs.h for the definition of vtvmSmip_SMIP_TYPE.  Note:  The Plug&Play spec prohibits exporting data structures, so the structure is not exported."
    s
    I get and exception when I use this as:
    myVtvmSmip.QuerySmip(1);
    didnt work gave me exception..
    Another fuction I coulduse was this one.
    myVtvmSmip.ReadNonvol();
    I guess this returns 1 module at a time.
    Definition:
    voidVtvmSmip.ReadNonvol(short smodNmbr, System.Text.StringBuilder nvData)
    I suppose smodnmbr responds to each module, 0, 1, 2, 3, 4, and 5.
    I hope this isnt too much information.. I just want to be able to read the serial numbers of of these switch modules so I can process them.  If anyone can help, that would be great.  Thanks.
    Chan

    Hi Matt,
    Thanks for your replay. Right now im trying to query the VXI Tech SMP1200 double slot carrier that holds 6 SMP5004 modules.  But I have other SMP switches as well after I figure this one out, I belive if I can do this one, they should be the same for the other switches.
    SMP1200 Product Link:
    http://www.vxitech.com/ProductDescription.aspx?PID​=218
    SMP5004 Product Link:
    http://www.vxitech.com/ProductDescription.aspx?PID​=242
    I belive I have the drivers from the manufacturer.  When I try to implement the code below, I get an exception error.
    The logical address of the SMP1200 Carrier is 26. And it has a resource name of "VXI0::26::INSTR" as should in NIMAX.
    The SMP1200 holds 6 switch modules and I think its zero based ( Module 1 is 0, Module 2 is 1, Module 3 is 2 etc..up to 5)
    reading through the vtSmipDefs.h file included with the drivers, It says QuerySmip() returns information about 6 modules at once.
    ReadNonvol() reads one module at a time I belive.  Not sure how this works because using these functions, they dont return a value.  I don't know If I have to somehow read it back.
    [CODE]
    private void button1_Click(object sender, System.EventArgs e)
     // This code creates and initializes an instance of the VXIplug&play wrapper class
     // TODO:  Insert your appropriate values for address, idQuery etc.
     Agilent.TMFramework.InstrumentDriverInterop.Vxipn​pWrappers.VtvmSmip myVtvmSmip;
     myVtvmSmip = new Agilent.TMFramework.InstrumentDriverInterop.Vxipnp​Wrappers.VtvmSmip("VXI0::26::INSTR", true, true);
     // TODO:  Add your code here.  For example:
     // myVtvmSmip.Reset();
    myVtvmSmip.QuerySmip(1);
    [CODE}
    The code above is automatically generated using the built in Agilent T&M Toolkit driver wrapper wizard in the menu in Visual Studio 2003.  using this code, the intellisense menu does appear to show all the class members functions from the driver.
    When I run the program, I get an exception error.
    Ill post the exact data as soon as im back at work.
    I can also send you a link to the drivers and the help files that have some information about it. 
    Im kinda a newbie here with programming in C# and also VXI/MXI.  This is just part of my whole application im writing.  So far I've been able to query all the instruments(meters, scopes, etc) through the GPIB using IDN query so far.  Just the VXI left and its killing me.  Appreciate you help.  Look forward to your reply.
    Thanks Chan

Maybe you are looking for

  • Issue with Save As option

    Hello Experts, I have BEx Web analyzer integrated with SAP- NW portal 7.0. Everything is working fine . I go to new analysis and select a query. After this when I go for " Save As" option. System and Type comes grayed out. Is there anyway to enable t

  • How to install extract assets plugins in photoshop cc

    how to install extract assets plugins in photoshop cc

  • Mail crashes when I type certain characters in the "to" or "cc" field

    MacBook Pro Retina 13" 2.6 GHz Intel Core i5 Mavericks 10.9.4 Mail Version 7.3 (1878.6) Not using iCloud. When I type certain characters, mail crashes. It happens with d, D, s, S, (no other single characters) and the sequence "rain", where I can type

  • Bug: "Paste Special: Value" overwrites data hidden with Table filters

    I've noticed the following.... Create a sheet with the values below and enable the "Filter" option on this table. (I've added the row-numbers on the left, to later show the filter in action) (1) col1 col2 (2) a 1 (3) a 2 (4) a 3 Using the filter opti

  • Podcasts not showing up as podcasts

    My podcasts do not show up under Podcasts on my Ipod. They only show up for a brief time under Playlists/Recently Added. They also do not show up if I use the search function on my Ipod. How do I get podcasts to show up as podcasts? Also, I have alre