これは、RDF ドキュメントに含まれるデータによって異なります。値が型付きリテラルの場合、SPARQL 結果セットを解析し、?y 変数にバインドされた値のデータ型を要求できます。値が RDF に準拠していない方法 (html など) でレンダリングされる場合、データ型が表示されない場合があります。それ以外の場合は、次のように表示されます。
<sparql xmlns="http://www.w3.org/2005/sparql-results#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd">
<head>
<variable name="y"/>
</head>
<results distinct="false" ordered="true">
<result>
<binding name="y"><literal xml:lang="en">John</literal></binding> //literals with language
</result>
<result>
<binding name="y"><literal datatype="http://www.w3.org/2001/XMLSchema#integer">30</literal></binding> //typed literals
</result>
...
データ型を抽出するには、Jena API を照会する必要があります。