SPARQL query - Construct

I, 

 

I’m using sparql with Jena, to make some queries. I have two ontologies
(src1 and tgt), and two rdf files were I have my instances, according to
this ontologies.

 


Caixa de texto: M1src1:

         person: Set of

                          personId

                          name

 addressId

                          addressSrc: Set of

                                                  adressIdSrc

street

                                                  pobox

tgt: 

employee: Set of

 employee:

 employeeId

 firstName

 lastName

 addressId

       addressTgt: Set of

          adressIdTgt

          address

 

 

 

I would like to use construct to obtain data from one ontology, according to
the other. Is it possible to make a concatenation (or a split), with
construct?

I made the query described above and I obtain all the first names, but what
I really wanted was to obtain the concatenation of firstName and lastName,
of tgt as the name of src1.

 

    private String QConstructSrcFromTgt =

        "CONSTRUCT { ?s rdf:type
<http://www.owl-ontologies.com/Ontology1200929461.owl#Person> ." + 

        "            ?s
<http://www.owl-ontologies.com/Ontology1200929461.owl#name> ?firstName" + 

        "} FROM <http://www.owl-ontologies.com/Ontology1200929459.owl> WHERE
{?s rdf:type ?o ." + 

         "               ?s
<http://www.owl-ontologies.com/Ontology1200929459.owl#firstName> ?firstName}
";

        //"               ?s
<http://www.owl-ontologies.com/Ontology1200929459.owl#lasttName> ?lastName.
"+

        //"       FILTER regex(?lastName, \"Castro\")    } ";

 

Thanks,

 

Ricardo Gabriel Soares Fernandes de Almeida.

 

----------------------------------------------------------------------------
---

Departamento de Engenharia Informática 

Instituto Superior de Engenharia 

Instituto Politécnico do Porto

 

Rua Dr. António Bernardino de Almeida, 431

4200-072 Porto

Portugal

Tel.:(+351) 228 340 500 / Fax.: (+351) 228 021 159

 

  _____  

Received on Tuesday, 9 September 2008 14:44:00 UTC