URLフォーマット

http:///q37_KGgenerator4BMTnetw3rdtep/< param >/[offset,limit][.format]

SPARQLクエリ

prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>
prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix sio: <http://semanticscience.org/resource/>
prefix id: <http://purl.jp/bio/4/id/>
prefix dc: <http://purl.org/dc/terms/>
prefix xkos: <http://rdf-vocabulary.ddialliance.org/xkos#>

select distinct  ?o2 ?ol2  ?o2_TO_o3 ?o3 ?ol3 ?o3_TO_o2

where{
  graph <http://nikkaji.biosciencedbc.jp/IOBC_1_2_0.ttl>{
  FILTER (?StartingPoint_TO_o1 != rdfs:subClassOf &&
          ?StartingPoint_TO_o1 != skos:broader &&
          ?StartingPoint_TO_o1 != skos:exactMatch &&
          ?StartingPoint_TO_o1 != skos:prefLabel &&
          ?StartingPoint_TO_o1 != dc:subject &&
          ?StartingPoint_TO_o1 != rdfs:seeAlso &&
          ?StartingPoint_TO_o1 != rdfs:label &&
          ?StartingPoint_TO_o1 != rdf:type &&
          ?StartingPoint_TO_o1 != dc:identifier &&
          ?StartingPoint_TO_o1 != dc:subject &&
          ?StartingPoint_TO_o1 != skos:altLabel &&
          ?StartingPoint_TO_o1 != rdfs:label &&
          ?StartingPoint_TO_o1 != skos:narrower
         )

  FILTER(?StartingPoint = <: $param :>)
         {?StartingPoint ?StartingPoint_TO_o1 ?o1.} #OPTIONAL {?o1 ?o1_TO_StartingPoint ?StartingPoint .}
         {?StartingPoint skos:prefLabel ?ol0.}
         {?StartingPoint dc:subject ?sub0.}
OPTIONAL {?StartingPoint rdfs:seeAlso ?als0.}
         {?o1 skos:prefLabel ?ol1 .}
         {?o1 dc:subject ?sub1.}
OPTIONAL {?o1 rdfs:seeAlso ?als1.}


# second step
  FILTER (?o2 != ?StartingPoint)
  FILTER (?o1_TO_o2 != rdfs:subClassOf &&
          ?o1_TO_o2 != skos:broader &&
          ?o1_TO_o2 != skos:exactMatch &&
          ?o1_TO_o2 != skos:prefLabel &&
          ?o1_TO_o2 != dc:subject &&
          ?o1_TO_o2 != rdfs:seeAlso &&
          ?o1_TO_o2 != rdfs:label &&
          ?o1_TO_o2 != rdf:type &&
          ?o1_TO_o2 != dc:identifier &&
          ?o1_TO_o2 != dc:subject &&
          ?o1_TO_o2 != skos:altLabel &&
          ?o1_TO_o2 != rdfs:label &&
          ?o1_TO_o2 != skos:narrower
         )

         {?o1 ?o1_TO_o2 ?o2 .} #OPTIONAL {?o2 ?o2_TO_o1 ?o1 .}
         {?o2 skos:prefLabel ?ol2 .}
         {?o2 dc:subject ?sub2.}
OPTIONAL {?o2 rdfs:seeAlso ?als2.}


# 3rd step
  FILTER (?o3 != ?StartingPoint)
  FILTER (?o2_TO_o3 != rdfs:subClassOf &&
          ?o2_TO_o3 != skos:broader &&
          ?o2_TO_o3 != skos:exactMatch &&
          ?o2_TO_o3 != skos:prefLabel &&
          ?o2_TO_o3 != dc:subject &&
          ?o2_TO_o3 != rdfs:seeAlso &&
          ?o2_TO_o3 != rdfs:label &&
          ?o2_TO_o3 != rdf:type &&
          ?o2_TO_o3 != dc:identifier &&
          ?o2_TO_o3 != dc:subject &&
          ?o2_TO_o3 != skos:altLabel &&
          ?o2_TO_o3 != rdfs:label &&
          ?o2_TO_o3 != skos:narrower
         )

         {?o2 ?o2_TO_o3 ?o3 .} OPTIONAL {?o3 ?o3_TO_o2 ?o2 .}
         {?o3 skos:prefLabel ?ol3 .}
         {?o3 dc:subject ?sub3.}
OPTIONAL {?o3 rdfs:seeAlso ?als3.}

}
}

説明


一覧に戻る