prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dcterms: <http://purl.org/dc/terms/>
prefix sio: <http://semanticscience.org/resource/>
prefix inchi: <http://glyconavi.org/inchi/>

SELECT DISTINCT ?id ?Skeleton ?nikkaji_id ?nikkaji_inchikey str
(?inchikey) AS ?knapsackinchikey
FROM NAMED <http://nikkaji.biosciencedbc.jp/iupac-inchi/KNApSAcK>
FROM NAMED <http://nikkaji.biosciencedbc.jp/InChI>
WHERE {

GRAPH <http://nikkaji.biosciencedbc.jp/iupac-inchi/KNApSAcK> {
  ?s dcterms:identifier ?id .
  ?s sio:CHEMINF_000200 / sio:SIO_000028 [ rdf:type inchi:Skeleton ;
sio:SIO_000300 ?Skeleton  ] .
  ?Skeleton bif:contains "FSBUXLDOLNLABB".
  ?s sio:CHEMINF_000200 [ sio:SIO_000300 ?inchikey ; rdf:type
sio:CHEMINF_000399 ] .
}

GRAPH <http://nikkaji.biosciencedbc.jp/InChI> {
 ?nikkaji_s <http://vocab.jst.go.jp/terms/sti#InChIKey> ?nikkaji_inchikey .
 ?nikkaji_inchikey bif:contains "FSBUXLDOLNLABB".
 ?nikkaji_s <http://purl.org/dc/terms/identifier> ?nikkaji_id .
}

FILTER ( ?inchikey != ?nikkaji_inchikey )
}
OFFSET 0
LIMIT 100
id Skeleton nikkaji_id nikkaji_inchikey knapsackinchikey
"C00002738"
"FSBUXLDOLNLABB"
"J1.868.239G"
"FSBUXLDOLNLABB-BBJJDDMMSA-N"
FSBUXLDOLNLABB-ABZFSZOUSA-N
"C00002738"
"FSBUXLDOLNLABB"
"J2.703.610D"
"FSBUXLDOLNLABB-GBYSIUQSSA-N"
FSBUXLDOLNLABB-ABZFSZOUSA-N
"C00002738"
"FSBUXLDOLNLABB"
"J362.655E"
"FSBUXLDOLNLABB-ISAKITKMSA-N"
FSBUXLDOLNLABB-ABZFSZOUSA-N
"C00002738"
"FSBUXLDOLNLABB"
"J2.773.261E"
"FSBUXLDOLNLABB-HSCIEKESSA-N"
FSBUXLDOLNLABB-ABZFSZOUSA-N
"C00002738"
"FSBUXLDOLNLABB"
"J2.701.456I"
"FSBUXLDOLNLABB-ISAKITKMSA-N"
FSBUXLDOLNLABB-ABZFSZOUSA-N
"C00002769"
"FSBUXLDOLNLABB"
"J2.773.261E"
"FSBUXLDOLNLABB-HSCIEKESSA-N"
FSBUXLDOLNLABB-MQAZSWENSA-N
"C00002769"
"FSBUXLDOLNLABB"
"J1.868.239G"
"FSBUXLDOLNLABB-BBJJDDMMSA-N"
FSBUXLDOLNLABB-MQAZSWENSA-N
"C00002769"
"FSBUXLDOLNLABB"
"J2.701.456I"
"FSBUXLDOLNLABB-ISAKITKMSA-N"
FSBUXLDOLNLABB-MQAZSWENSA-N
"C00002769"
"FSBUXLDOLNLABB"
"J362.655E"
"FSBUXLDOLNLABB-ISAKITKMSA-N"
FSBUXLDOLNLABB-MQAZSWENSA-N
"C00002769"
"FSBUXLDOLNLABB"
"J2.703.610D"
"FSBUXLDOLNLABB-GBYSIUQSSA-N"
FSBUXLDOLNLABB-MQAZSWENSA-N