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

  • SEARCH
  • Home
  • 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 6245195
In Process

The Archive Base Latest Questions

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

I’m starting to work with the Jena Engine and I think I got a

  • 0

I’m starting to work with the Jena Engine and I think I got a grasp of what semantics are.
However I’m having a hard time understanding the different ways to represent a bunch of triples in Jena and ARQ:

  • The first thing you stumble upon when starting is Model and the documentation says its Jenas name for RDF graphs.
  • However there is also Graph which seemed to be the necessary tool when I want to query a union of models, however it does not seem to share a common interface with Model, although one can get the Graph out of a Model
  • Then there is DataSet in ARQ, which also seems to be a collection of triples of some sort.

Sure, afer some looking around in the API, I found ways to somehow convert from one into another. However I suspect there is more to it than 3 different interfaces for the same thing.

So, question is: What are the key design differences between these three? When should I use which one ? Especially: When I want to hold individual bunches of triples but query them as one big bunch (union), which of these datastructures should I use (and why)?
Also, do I “loose” anything when “converting” from one into another (e.g. does model.getGraph() contain less information in some way than model)?

  • 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-24T12:27:44+00:00Added an answer on May 24, 2026 at 12:27 pm

    Jena is divided into an API, for application developers, and an SPI for systems developers, such as people making storage engines, reasoners etc.

    DataSet, Model, Statement, Resource and Literal are API interfaces and provide many conveniences for application developers.

    DataSetGraph, Graph, Triple, Node are SPI interfaces. They’re pretty spartan and simple to implement (as you’d hope if you’ve got to implement the things).

    The wide variety of API operations all resolve down to SPI calls. To give an example the Model interface has four different contains methods. Internally each results in a call:

    Graph#contains(Node, Node, Node)
    

    such as

    graph.contains(nodeS, nodeP, nodeO); // model.contains(s, p, o) or model.contains(statement)
    graph.contains(nodeS, nodeP, Node.ANY); // model.contains(s, p)
    

    Concerning your question about losing information, with Model and Graph you don’t (as far as I recall). The more interesting case is Resource versus Node. Resources know which model they belong to, so you can (in the api) write resource.addProperty(...) which becomes a Graph#add eventually. Node has no such convenience, and is not associated with a particular Graph. Hence Resource#asNode is lossy.

    Finally:

    When I want to hold individual bunches of triples but query them as one big bunch (union), which of these datastructures should I use (and why)?

    You’re clearly a normal user, so you want the API. You want to store triples, so use Model. Now you want to query the models as one union: You could:

    • Model#union() everything, which will copy all the triples into a new model.
    • ModelFactory.createUnion() everything, which will create a dynamic union (i.e. no copying).
    • Store your models as named models in a TDB or SDB dataset store, and use the unionDefaultGraph option.

    The last of these works best for large numbers of models, and large model, but is a little more involved to set up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an XML file, the creators of it stuck in a bunch social
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

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.