SPARQLクエリで検索対象データの特徴を取得

RDFトリプルストアのVirtuosoをインストールして利用可能になるSPRQLエンドポイントに予め記入されているクエリとして以下のものがある。

SELECT DISTINCT ?C WHERE {[] a ?C}

意味のある結果が得られるためには検索対象に rdf:type (つまり a ) が使われているトリプルがある場合のみに限られるが、参考程度には使える。

例えば、様々なSPARQLエンドポイントの状態を一覧で得られるサイトのSPARQLエンドポイントで得られる結果は以下の二つのみ。

http://rdfs.org/ns/void#Dataset
http://labs.mondeca.com/vocab/endpointStatus#EndpointStatus

思ったよりも少なかった。また、最近SPARQLエンドポイントを立ち上げた国立国会図書館においては以下の通り。
http://xmlns.com/foaf/0.1/Organization
http://xmlns.com/foaf/0.1/Person
http://RDVocab.info/uri/schema/FRBRentitiesRDA/Family

こちらもシンプル。オントロジーも併せて検索対象にしておいて頂けると、クエリを組み立てる際に非常に役立つと思う。

因みにAllieSPARQLエンドポイントでは以下の結果が得られる。

http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat
http://www.openlinksw.com/schemas/virtrdf#array-of-QuadMapFormat
http://www.openlinksw.com/schemas/virtrdf#QuadMap
http://www.openlinksw.com/schemas/virtrdf#QuadMapValue
http://www.openlinksw.com/schemas/virtrdf#array-of-QuadMapColumn
http://www.openlinksw.com/schemas/virtrdf#QuadMapColumn
http://www.openlinksw.com/schemas/virtrdf#array-of-QuadMapATable
http://www.openlinksw.com/schemas/virtrdf#QuadMapATable
http://www.openlinksw.com/schemas/virtrdf#QuadMapFText
http://www.openlinksw.com/schemas/virtrdf#array-of-string
http://www.openlinksw.com/schemas/virtrdf#QuadStorage
http://www.openlinksw.com/schemas/virtrdf#array-of-QuadMap
http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
http://www.w3.org/2002/07/owl#Class
http://www.w3.org/2002/07/owl#Ontology
http://www.w3.org/2000/01/rdf-schema#Class
http://www.w3.org/2002/07/owl#OntologyProperty
http://www.w3.org/2002/07/owl#AnnotationProperty
http://www.w3.org/2002/07/owl#Restriction
http://www.w3.org/2002/07/owl#ObjectProperty
http://www.w3.org/2002/07/owl#DatatypeProperty
http://www.w3.org/2002/07/owl#InverseFunctionalProperty
http://purl.org/allie/ontology/201102#PubMedID
http://purl.org/allie/ontology/201102#ShortForm
http://purl.org/allie/ontology/201102#Pair
http://purl.org/allie/ontology/201102#PairList
http://purl.org/allie/ontology/201102#PubMedIDList
http://purl.org/allie/ontology/201102#ResearchArea
http://purl.org/allie/ontology/201102#CooccurringShortFormList
http://purl.org/allie/ontology/201102#LongForm
http://purl.org/allie/ontology/201102#PairCluster

openlinksw.comドメインを持つクラスはVirtuoso固有にビルトインされているクラスで、その他、owlやrdf、rdfsに含まれるクラスとともに、Allieで用いられているクラスのリストが列挙されている。

また、

select distinct ?P where {?P a owl:ObjectProperty}

や、

select distinct ?P where {?P a owl:DatatypeProperty}

とすれば術語の一覧が得られる。