Looks like you are missing a period after this triple:

 

?r owl:onProperty hasBO_Target

 

Also, you need to either specify a qname (myprefix: hasBO_Target) or if you
are using default namespace put a column in front of the property
(:hasBO_Target)

 

Irene Polikoff 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Leonard Jacuzzo
Sent: Wednesday, May 18, 2011 12:48 PM
To: [email protected]
Subject: Re: [topbraid-users] SPARQL help.

 

Thanks Again!

 

I gave this a shot. But TBC tells me that it is not well formed. The message
that I got is "lexical error at line 3, column38. Encountered "\n" after
"hasBO_Target" .

I can't seem to figure out what that means and how to correct it. 

See query below. Best, LFJ

CONSTRUCT

{ ?r ?p ?o. 

?c

rdfs:subClassOf ?r .} 

WHERE

{?r owl:onProperty hasBO_Target 

?r

?p ?o . 

?c

rdfs:subClassOf ?r .}

On Tue, May 17, 2011 at 6:35 PM, Holger Knublauch <[email protected]>
wrote:

Yes, to get all restrictions on a given property, try something like 

 

?r owl:onProperty ex:myProperty .

 

BTW, in Irene's example below SPARQL 1.1 offers a short notation using
DELETE WHERE, e.g.

 

DELETE WHERE {

?r owl:onProperty ex:myProperty .

?r ?p ?o .

?class rdfs:subClassOf ?r .

}

 

would delete all triples matched in the WHERE clause. This requires TopBraid
3.5 or above.

 

Holger

 

 

On May 18, 2011, at 7:56 AM, Leonard Jacuzzo wrote:





Thanks Guys,

But I have a ton of anoymous classes. If I run this query, I will have to
manually go through each triple to find the ones that I want. How do I
target a  restriction involving a particular property and not the others? 

 

Would I substitute the name of the property for '?Prop' in Irene's solution?

 

Best,

LFJ

 

On Tue, May 17, 2011 at 3:16 PM, Gokhan Soydan <[email protected]>
wrote:

Leonard,

First, you could also run SELECT like the following to review what
restrictions to delete.

SELECT ?c ?r ?p ?o
WHERE {
    ?c rdfs:subClassOf ?r .
    ?r a owl:Restriction .
    ?r ?p ?o .
}

Gokhan 



On 5/17/2011 12:06 PM, Irene Polikoff wrote: 

Something like this should work

 

DELETE {?r ?p ?o .

?c rdfs:subClassOf ?r .}

WHERE {?r owl:onProperty ?prop.

?r ?p ?o .

?c rdfs:subClassOf ?r .}

 

I always recommend running CONSTRUCT before doing the delete. This way you
will be able to review all triples that are about to be deleted.

 

Irene 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Leonard Jacuzzo
Sent: Tuesday, May 17, 2011 1:01 PM
To: [email protected]
Subject: [topbraid-users] SPARQL help.

 

Hi all,

 

Once again  I would like to take advantage of your collective wisdom. I have
created an ontology with several hundred classes, which are characterized by
relations to restrictions on properties, i.e., anonymous classes.
Unfortunately, once I was finished, I discovered that I made a particular
error for each class definition. 


So I need to delete the erroneous triples and replace each with the
appropriate value for each. 

 

My strategy was to select them all and then delete them all via SPARQL. But
I cannot figure out how to write the query as it involves restrictions on
properties and anonymous classes. 

 

Each class has a subclass relation as follows:

 

rdfs:subClassOf

[ a owl:Restriction ;

owl:hasValue "0.087"^^xsd:string ;

owl:onProperty :hasBO_Target

]


Each will have a unique value as well.

So how do I find all of these triples?

Any help will be greatly appreciated.

Best wishes,

Leonard

 

 

-- 
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

-- 
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

 

 

-- 
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]
<mailto:topbraid-users%[email protected]> 
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

 

 

-- 
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

 

-- 
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]
<mailto:topbraid-users%[email protected]> 
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

 

-- 
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

-- 
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