Hello, 

Sorry for not being more specific. 
I am trying to get all the ?s and ?p that has for instance "Emri" as object.
Then I want to use the above value of ?s, change the value of the predicate to 
<http://www.w3.org/TR/html4/Class1> and get all the objects with that match. 

The problem is that when I query just 
                
                ?s ?p ?attr .
                FILTER regex(?attr , "Emri"). 

-----I get the three results, one of them is:
        
_:b0
        
<http://www.w3.org/TR/html4/Name>
        
"Emri"
----------------
When I query just for:

 _:b0 <http://www.w3.org/TR/html4/Class1> ?class .

----I get many objects as result.

But, then I try this: 

                ?s ?p ?attr .
                FILTER regex(?attr , "Emri") .
                ?s <http://www.w3.org/TR/html4/Class1> ?class .                 
                                                           

then I get no matches? Is there maybe because there are three subjects returned 
from the first query(?s ?p ?attr .), or can I not change the value of the 
predicate on the second query after it has been initialized from the first one.

Thanks a lot for your help.









On 2021/04/01 05:57:41, Lorenz Buehmann <buehm...@informatik.uni-leipzig.de> 
wrote: 
> without showing the data impossible to help, sorry. I mean, in the end 
> the query has to match the data, but we only know the query know - so 
> how can we help here?
> 
> One possible error is the triple pattern
> 
> ?s <http://www.w3.org/TR/html4/Class1> ?class .
> 
> 
> what is the idea behind this? Is there really a property <Class1> in the 
> data? If not and if you want to get an instance of the Class <Class1> 
> you have to use
> 
> ?s a <http://www.w3.org/TR/html4/Class1> .
> 
> On 31.03.21 16:12, emri mbiemri wrote:
> > Dear all,
> >
> > I am trying to query something from an RDF/XML file with SPARQL but when I 
> > try queries like this:
> >
> > SELECT DISTINCT ?class
> > WHERE {
> >   
> >             ?s ?p ?attr .
> >                  FILTER regex(?attr , "Emri") .
> >             ?s <http://www.w3.org/TR/html4/Class1> ?class .
> >
> > it should after the FILTER command initialize ?s = _:b0 , but it doesn't?
> >
> > Hope for any support.
> 

Reply via email to