Hi , although I constantly try and learn, my understanding of sparql
queries is still on the basic side.

I am trying to construct a set of triples from  members contained two
classes, I have been tying to use a union statement but have not been
able to get back the triples I require. I wonder if you could help.

I have Class A with an instance lets say page1 with a predicate of
hasHeadingType

page1 hasHeadingType ?headingType

with ?headingType being a member of Class B

I am trying to get back a list of tripels in one query that includes
the following.

All the ?s ?p ?o that relate to page 1 ie

page1 hastext abc
page1 hasfontweight bold
page1 hascolour red
....
coulpled with

headngType hasborder true
headingType hassplitBox true
......

resulting in the xml output result

page1 hastext abc
page1 hasfontweight bold
page1 hascolour red
headngType hasborder true
headingType hassplitBox true

To date I have come up with this

CONSTRUCT {
    ?s ?p ?o .
}
WHERE {
    {
        ?s coreModel:source ?arg2
        ?s coreModel:pageNumber ?arg1 .
        ?s ?p ?o .
    }
    UNION
    {
        ?s coreModel:hasHeaderType ?headerType .
        ?headerType ?p ?o .
    } .
}

which does has the results, but not as I need them, Once I get back
the results from the query in rdf/xml I need to parse by resource type
ie page or heading, the above returns the results as properties of the
page not of the page and heading.

If it helps the only propety in common in both classes is the source,
ie arg2 from above

Hope you understand , nver very good at explaing :-)

Thanks in advance once again

John

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to