Jena/ARQ: Difference between Model, Graph and DataSet

前端 未结 2 1826
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 22:20

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

2条回答
  •  孤街浪徒
    2021-01-30 22:28

    Short answer: Model is just a stateless wrapper with lots of convenience methods around a Graph. ModelFactory.createModelForGraph(Graph) wraps a graph in a model. Model.getGraph() gets the wrapped graph.

    Most application programmers would use Model. Personally I prefer to use Graph because it's simpler. I have trouble remembering all the cruft on the Model class.

    Dataset is a collection of several Models: one “default model” and zero or more “named models”. This corresponds to the notion of an “RDF dataset” in SPARQL. (Technically speaking, SPARQL is not a query language for “RDF graphs” but for “RDF datasets” which can be collections of named RDF graphs plus a default graph.)

提交回复
热议问题