[Pellet-users] SPARQL and range and Pellet
David Leston Palmas
davles7 at hotmail.com
Tue Apr 7 21:41:33 UTC 2009
Ok thank you Mr. Evren. I will try it.
Regards
> From: evren at clarkparsia.com
> Date: Tue, 7 Apr 2009 16:15:11 -0400
> To: pellet-users at lists.owldl.com
> Subject: Re: [Pellet-users] SPARQL and range and Pellet
>
> 2009/4/2 David Leston Palmas <davles7 at hotmail.com>:
> > Hi everybody!
> >
> > I have one question about the ranges in a SPARQL query.
> >
> > I have this piece of ontology:
> >
> [snip]
>
> >
> > Look that "era" Property not has a range in the declaration (range Any in
> > Protege), but has a gYear in Articulo_1
> >
> > Ok I want to execute this query:
> >
> >
> > PREFIX : <http://www.owl-ontologies.com/castellano.owl#>
> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> > PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
> > SELECT DISTINCT ?article ?y
> > WHERE {
> > ?article :era \"2009\"^^xsd:gYear.
> > ?article :titulo ?y .
> > ?article a :Articulo .
> > }
> >
> > But the problem is that I don´t know xsd:gYear, that is the gYear range is
> > a variable. If I put another range instead of gYear, pellet tells me that in
> > StringValue occurs an error.
> >
> > But when I execute property.getRange() the range is null. This is for the
> > no declaration of the range. Then I have one questions, there is any form to
> > know the range WITHOUT KNOW THE ID Articulo_1?(I don´t know the id of the
> > individual). there is any form to make something for can execute correctly
> > the query?
>
> The issue is not related to the range of the property but to the
> datatype of the literal. Basically you'd like to retrieve a literal
> value regardless of its datatype. You can do this with the foqlloing
> query:
>
> SELECT DISTINCT ?article ?y
> WHERE
> { ?article :era ?era ;
> :titulo ?y ;
> a :Articulo .
> FILTER ( str(?era) = "2009" )
> }
>
> This will match with literals "2009", "2009"^^xsd:int, "2009"^^xsd:gyear, etc.
>
> Cheers,
> Evren
>
> >
> > Thank You Regards
> >
> >
> >
> >
> > ________________________________
> > ¿Quieres estar al día de la últimas novedades? ¡Apúntate gratis aquí!
> > _______________________________________________
> > Pellet-users mailing list
> > Pellet-users at lists.owldl.com
> > http://lists.owldl.com/mailman/listinfo/pellet-users
> > _______________________________________________
> >
> > Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
> >
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
_________________________________________________________________
¿Quieres que tus hijos naveguen seguros? Aprende aquí cómo con Protección Infantil
http://www.protegeatushijos.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20090407/9b623358/attachment.htm
More information about the Pellet-users
mailing list