Scott, sry but I only get one result with that query , because as you
suggested in a previous post I have the classes List and ListItem as
subclasses of Concept , and have built the hierachy with the instances
of these classes so all the instances are of type List or List item,
apart from the top one. Here is the source of each of the top 3
cop:Concept_1
a skos:Concept ;
rdfs:label "Concept 1"^^xsd:string ;
skos:narrower cop:List_Content .
cop:List_Content
a cop:List ;
rdfs:label "Contents List"^^xsd:string ;
skos:broader cop:Concept_1 ;
skos:broaderTransitive
cop:Concept_1 ;
skos:narrower cop:List_Item_Part_2 , cop:List_Item_Part_1 ,
cop:List_Item_Part_3 ;
skos:narrowerTransitive
cop:List_Item_II_1 , cop:List_Item_10_1_1 ,
cop:List_Item_5_8 , cop:List_Item_15_10_1 .............................
100more
cop:List_Item_Chapter_1
a cop:List_Item ;
rdfs:label "List Item Chapter 1"^^xsd:string ;
coreModel:list_Item_Text
"Scope"^^xsd:string ;
coreModel:list_Order_Number
1 ;
coreModel:source <http://cortext.net/library/
publishedBooks#IEE_Code_of_Practice_3rd_Edition> ;
composite:index "1"^^xsd:int ;
skos:broader cop:List_Item_Part_1 ;
skos:broaderTransitive
cop:List_Content , cop:List_Item_Part_1 ;
skos:narrower cop:List_Item_1_1 , cop:List_Item_1_2 ,
cop:List_Item_1_3 , cop:List_Item_1_4 , cop:List_Item_1_5 ;
skos:narrowerTransitive
cop:List_Item_1_1_3 , cop:List_Item_1_1 ,
cop:List_Item_1_2 , cop:List_Item_1_3 , cop:List_Item_1_4 ,
cop:List_Item_1_1_1 , cop:List_Item_1_1_2 , cop:List_Item_1_1_4 ,
cop:List_Item_1_5 ;
skos:semanticRelation
cop:List_Item_1_1_3 , cop:List_Item_1_1 ,
cop:List_Item_1_2 , cop:List_Item_1_3 , cop:List_Item_1_4 ,
cop:List_Item_1_1_1 , cop:List_Content , cop:List_Item_Part_1 ,
cop:List_Item_1_1_2 , cop:List_Item_1_1_4 , cop:List_Item_1_5 .
The first instance is type Concept the second list and the third
ListItem, all subsequent instances are listitems.
If i change the query to
CONSTRUCT {
?concept ?p ?o .
}
WHERE {
?concept a cop:List .
?concept ?p ?o .
}
I get all of the narrower instances as a flat file
<rdf:Description rdf:about="http://cortext.net/library/publishedBook/
codeOfPractice_3rd_Edition#List_Content">
<skos:semanticRelation rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice_3rd_Edition#List_Item_6_2"/>
<skos:narrowerTransitive rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice_3rd_Edition#List_Item_10_6"/>
<coreModel:source rdf:resource="http://cortext.net/library/
publishedBooks#IEE_Code_of_Practice_3rd_Edition"/>
<skos:narrowerTransitive rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice_3rd_Edition#List_Item_II_6"/>
<skos:narrowerTransitive rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice_3rd_Edition#List_Item_9_2"/>
<skos:narrowerTransitive rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice_3rd_Edition#List_Item_V_2_6"/>
<skos:broader rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice_3rd_Edition#Concept_1"/>
............................................
<skos:narrowerTransitive rdf:resource="http://cortext.net/library/
publishedBook/codeOfPractice
</rdf:Description>
</rdf:RDF
what I am trying to get at and please forgive me if it is my lack of
knowlege , is list of all the above each with their own properties as
elements of that node preferably with the heirachy intact
John
On Mar 1, 5:56 pm, Scott Henninger <[email protected]> wrote:
> Hello John; I'm not entirely sure what you are looking for, but you
> may be making it a bit harder than necessary. If you get all of your
> SKOS concepts and all of their properties, then the hierarchy will
> remain intact, as it is represented by the skos:borader or
> skos:narrower property. So the query can simply be:
>
> CONSTRUCT {?concept ?p ?o .}
> WHERE {
> ?concept a skos:Concept .
> ?concept ?p ?o .
>
> }
>
> If that's not what you're getting at, let me know.
>
> On "would it be possible to have someway of permantly seeing all the
> options on the sparql syntax checker", the overall problem is that the
> syntax check is continuous and needs to go away when the error is
> fixed, so it can't be a pop-up window. If you hover over again, the
> tooltip will appea again.
>
> -- Scott
>
> On Mar 1, 10:49 am, John Perdoni <[email protected]> wrote:
>
>
>
> > Hi again !!!
>
> > Just wondering what is the best way to traverse a skos tree with a
> > sparql query and keep the tree intact when exporting to rdfxml. with a
> > SM script from a web call
>
> > So far I have only come up with the following poor attempt which gives
> > me all the info i need but loses all hireachy if you understand what i
> > mean.
>
> > CONSTRUCT {
> > ?list ?p3 ?o3 .
> > ?o4 ?p4 ?o5 .
> > ?o7 ?p5 ?o8 .
>
> > }
>
> > WHERE {
> > {
> > ?s coreModel:source ?arg2 .
> > ?s coreModel:page ?arg1 .
> > ?s coreModel:contains_List ?list .
> > ?singleList ?p3 ?o3 .
> > FILTER (?p3 != skos:narrowerTransitive) .
> > FILTER (?p3 != skos:semanticRelation) .
> > }
> > UNION
> > {
> > ?s coreModel:source ?arg2 .
> > ?s coreModel:pageNumber ?arg1 .
> > ?s coreModel:contains_List ?list .
> > ?list skos:narrower ?o4 .
> > ?o4 ?p4 ?o5 .
> > FILTER (?p4 != skos:narrowerTransitive) .
> > FILTER (?p4 != skos:semanticRelation) .
> > FILTER (?p4 != skos:broaderTransitive) .
> > } .
> > UNION
> > {
> > ?s coreModel:source ?arg2 .
> > ?s coreModel:pageNumber ?arg1 .
> > ?s coreModel:contains_List ?list .
> > ?list skos:narrower ?o6 .
> > ?o6 ?skos:narrower ?o7
> > ?o7 ?p5 ?o8 .
> > FILTER (?p5 != skos:narrowerTransitive) .
> > FILTER (?p5 != skos:semanticRelation) .
> > FILTER (?p5 != skos:broaderTransitive) .
> > } .
>
> > .........
> > and so on down the tree
>
> > Could I possible create a SM script for this,
>
> > Also as a feature request, would it be possible to have someway of
> > permantly seeing all the options on the sparql syntax checker (the red
> > line of text that appears at the bottom of the screen when writing a
> > query) if the options are wider than the screen,i know you can hover
> > over it but it just disappears just at the wrong time lol...
>
> > Thanks again and one day maybe I will have learnt enough to be able to
> > stop pestering you.
>
> > John- Hide quoted text -
>
> - Show quoted text -
--
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