Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6552421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:27:28+00:00 2026-05-25T12:27:28+00:00

I want to index two different OntModel and execute sparql queries on them. For

  • 0

I want to index two different OntModel and execute sparql queries on them. For example:

String query = "PREFIX fise: <http://fise.iks-project.eu/ontology/>\n"
                   + "PREFIX pf: <http://jena.hpl.hp.com/ARQ/property#>\n"
                   + "PREFIX skos:   <http://www.w3.org/2004/02/skos/core#>\n"
                   + "SELECT distinct ?def\n" + "WHERE {\n"
                   + "  ?item a skos:Concept .\n"
                   + "  ?item skos:definition ?def.\n"
                   + "  (?label ?score)  pf:textMatch 'someKeyword'. \n"
                   + "};

ResultSet result = QueryExecutionFactory.create(query, ontModel1).execSelect();
ResultSet result2 = QueryExecutionFactory.create(query, ontModel2).execSelect();

How can I create different indexes for the two ont models or should I do that? Eventually, what I need is to query the two ont models using LARQ features.

As far as I understand to be able to use lucene features in while executing SPARQL, we need to implement a code like the following one.

IndexBuilderString larqBuilder = new IndexBuilderString();
larqBuilder.indexStatements(ontModel.listStatements());
IndexLARQ index = larqBuilder.getIndex();
LARQ.setDefaultIndex(index);

But this code allows setting a single index. Furthermore, I don’t want to merge two ont models. There is a Concext concept but I didn’t get how to use it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:27:29+00:00Added an answer on May 25, 2026 at 12:27 pm

    It seems the answer is registering indexes per-query execution using the context of query.

     QueryExecution qe = QueryExecutionFactory.create(query, model) ;
     LARQ.setDefaultIndex(qe.getContext(), index) ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string with two different delimiters (| and ~). I want to
I want to change url for example http://localhost/mysite/index.php?page=about will become http://localhost/mysite/index/about I also used
I want to redirect all requests for index.html|php|php5 to http://www.domain.co.uk/ using mod_rewrite and I've
I want to be able to access the same page in two different ways:
Many times I'm making two different changes to files in my repository, I want
I want to break down a JSON string into smaller objects. I have two
I'm adding two different elements to both std::list and std::set and I want the
Suppose you want a Blog with two different layouts. One layout should look like
On a pageLoad event I want to go to two different SharePoint Lists and
I'm creating tables using phpMyAdmin and want to define two different columns as indices.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.