It's always easier if you can provide actual data that we can query. In the future, please provide data that we can query. because then we can actually test queries against it. In any case, here's a very simple dataset with two resources, one which has an xsd:decimal value and one with an xsd:integer value.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix uni: <http://localhost/SemanticSearch/semanticsearch.owl#>.
@prefix : <urn:ex:>.
:a uni:altLabel "5"^^xsd:integer ; a :somethingWithAnInteger .
:b uni:altLabel "5"^^xsd:decimal ; a :somethingWithADecimal .
You can filter for the particular datatypes that you want using the datatype function:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX uni: <http://localhost/SemanticSearch/semanticsearch.owl#>
SELECT DISTINCT * WHERE {
?uri uni:altLabel ?altLabel .
?uri rdf:type ?type
filter(?altLabel = "5"^^xsd:integer && datatype(?altLabel) = xsd:integer)
}
-----------------------------------------------------------
| uri | altLabel | type |
===========================================================
| <urn:ex:a> | 5 | <urn:ex:somethingWithAnInteger> |
-----------------------------------------------------------