Is CONSTRUCT query persistent after execution?

Dear All,

I have been looking around here but I could not find an answer to my question. I am trying to define some basic inference on my triple store and i see that one easy way to do it is to use CONSTRUCT. However I was wondering, in order to avoid confusion, what is the difference between INSERT and CONSTRUCT. It is easy to infer that INSERT inserts new triples in the triple store, but i do not know if the result of the construct query should be also made persistent in the triple store or not.

Regards.

EDIT

Thank you Rob for the quick reply.

So i am wondering in which scenarios can be used the inference defined by the CONSTRUCT statement. I am considering a scenario where a user submits a query like:

SELECT ?a 
WHERE {?a rdf:type Assigment.}

and the following triples:

Project rdfs:subClassOf Assigment
JavaProject rdfs:subClassOf Project
proj1 rdf:type Assigment
proj2 rdf:type Project
proj3 rdf:type JavaProject

in case no inference is in place I should get only a={proj1}, in case semantics of rdfs:subClassOf is interpreted i will have a={proj1, proj2, proj3}.

What I am wondering is that in this case the CONSTRUCT can not help, unless I embed it in the query the user submits. So I should write something like :

SELECT ?a 
    WHERE {?a rdf:type Assigment.
  { 
    CONSTRUCT {?x rdfs:subClassOf ?z} 
      WHERE { 
       ?x rdfs:subClassOf ?y.
       ?y rdfs:subClassOf ?z. 
    }
  }
  { 
    CONSTRUCT {?i rdf:type ?j} 
      WHERE { 
       ?i rdf:type ?k.
       ?k rdfs:subClassOf ?j. 
    }
  }
}

which is SPARQL 1.1. So in this case is the person submitting the query that is defining the semantic of subClassOf. In case the admin of the system was to infer the triples I should use INSERT which still is SPARQL 1.1 or SPARUL. So concluding in SPARQL 1.0 I can not define persistent inference queries. Am I right?

Thank you

No a CONSTRUCT is not persistent.

CONSTRUCT is designed to allow you to extract data from the triple store and generate an RDF Graph of your choosing from it for your local use.

Yes as you state INSERT can be thought of as a persistent form of CONSTRUCT.

INSERT is designed for constructing new Triples and persisting them to the Triple Store.

Edit

No you cannot use CONSTRUCT in that way since it is no valid as use as a sub-query.

If what you are trying to achieve is some form of inference using only SPARQL 1.1 you may be better off using Property Paths e.g.

SELECT ?s WHERE
{
  { ?s a ex:YourDesiredType }
  UNION
  { 
    ?subtype rdfs:subClassOf+ ex:YourDesiredType .
    ?s a ?subtype .
  }
}

Or you could materialise some of the inferences using an INSERT yourself e.g.

INSERT
{ ?s a ?supertype }
WHERE
{ 
  ?subtype rdfs:subClassOf+ ?supertype .
  ?s a ?subtype .
}

If you need inference for lots of your queries consider using a reasoner to materialise all the inferences you desire or using a query engine that supports RDFS reasoning.