rdf.glytoucan.org(from gs2virt)をバラす

Virtuoso note

VirtuosoのSPARQLの結果件数の設定
ResultSetMaxRows = 100万(テスト環境&本番環境)
テスト環境では、CONSTRCTで全て取れた
本番環境では、CONSTRCTで全て取れなかった

GRAPHの削除

log_enable(2,1);
sparql clear graph <graph name>;

Target GRAPH

From
http://rdf.glytoucan.org (made by gs2virt)

To
http://rdf.glytoucan.org/core
including following classes

http://rdf.glytoucan.org/sequence/glycoct
including following classes

http://rdf.glytoucan.org/image
including following classes

http://rdf.glytoucan.org/motif
including following classes

Saccharide Class

Fromhttp://rdf.glytoucan.org
Tohttp://rdf.glytoucan.org/core

Instance URI Proerty Class Instance URI Literal Literal Individual
Saccharide instance a glycan:saccharide      
  glycan:has_motif   Glycan motif instance    
  glycan:has_image   Image instance    
  glycan:has_resource_entry   Glycosequence instance    
  glycan:has_component   component instance    
  glytoucan:has_primary_id     “Accession number”  

INSERT query

log_enable(2,1);
sparql
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>
INSERT
{ GRAPH <http://rdf.glytoucan.org/core> {
    ?Saccharide a glycan:saccharide .
    ?Saccharide glytoucan:has_primary_id ?AccessionNumber .
    ?Saccharide glycan:has_resource_entry ?ResourceEntry .
  }
}
USING <http://rdf.glytoucan.org>
WHERE {
    # Saccharide
    ?Saccharide a glycan:saccharide .
    ?Saccharide glytoucan:has_primary_id ?AccessionNumber .
    ?Saccharide glycan:has_resource_entry ?Entry .
    BIND(STR(?Entry) AS ?strEntry)
    BIND(STRAFTER(?strEntry, "http://glytoucan.org/Structures/Glycans/") AS ?AccNum)
    BIND(IRI(CONCAT("http://rdf.glycoinfo.org/resource-entry/", ?AccNum)) AS ?ResourceEntry)
};
checkpoint;
commit WORK;

confirm query

# Saccharide 
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>

SELECT ?ResourceEntry
#SELECT count(?ResourceEntry)
#SELECT count(?Saccharide)
#FROM <http://rdf.glytoucan.org>
FROM <http://rdf.glytoucan.org/core>
WHERE {
    # Saccharide
    #?Saccharide a glycan:saccharide .
    #?Saccharide glytoucan:has_primary_id ?AccessionNumber .
    #?Saccharide glycan:has_resource_entry ?ResourceEntry .
    #?Saccharide glycan:has_resource_entry ?ResourceEntry .
}
limit 200

Resource entry Class

Fromhttp://rdf.glytoucan.org
Tohttp://rdf.glytoucan.org/core

Instance URI Proerty Class Instance URI Literal Literal Individual
Resource entry instance a glycan:resource_entry      
  glytoucan:contributor   Person instance    
  glytoucan:date_registered     dateTimestamp  
  dcterms:identifier     Accession number  
  rdfs:seeAlso     GlyTouCan URL  
  glycan:in_glycan_database       glytoucan:database_glytoucan

INSERT query

log_enable(2,1);
sparql
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>
PREFIX dcterms: <http://purl.org/dc/terms/>

INSERT
{ GRAPH <http://rdf.glytoucan.org/core> {
    ?ResourceEntry a glycan:resource_entry .
    ?ResourceEntry glytoucan:contributor ?Contributor .
    ?ResourceEntry glytoucan:date_registered ?Date .
    ?ResourceEntry glycan:in_glycan_database ?DB .
    ?ResourceEntry dcterms:identifier ?AccessionNumber .
    ?ResourceEntry rdfs:seeAlso ?Entry .
  }
}
USING <http://rdf.glytoucan.org>
WHERE {
    # Resource entry
    ?Saccharide glytoucan:has_primary_id ?AccessionNumber .
    ?Saccharide glycan:has_resource_entry ?Entry .
    ?Entry a glycan:resource_entry .
    ?Entry glytoucan:contributor ?Contributor .
    ?Entry glytoucan:date_registered ?Date .
    ?Entry glycan:in_glycan_database ?DB .
    BIND(STR(?Entry) AS ?strEntry)
    BIND(STRAFTER(?strEntry, "http://glytoucan.org/Structures/Glycans/") AS ?AccNum)
    BIND(IRI(CONCAT("http://rdf.glycoinfo.org/resource-entry/", ?AccNum)) AS ?ResourceEntry)
};
checkpoint;
commit WORK;

Confirm query

# Resource entry 
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT *
#SELECT COUNT(?AccessionNumber)
#SELECT COUNT(?DB)
#SELECT COUNT(?Date)
#SELECT COUNT(?Contributor)
#SELECT COUNT(?ResourceEntry)
#FROM <http://rdf.glytoucan.org>
FROM <http://rdf.glytoucan.org/core>
WHERE {
    # New Resource entry
    #?ResourceEntry a glycan:resource_entry .
    #?ResourceEntry glytoucan:contributor ?Contributor .
    #?ResourceEntry glytoucan:date_registered ?Date .
    #?ResourceEntry glycan:in_glycan_database ?DB .
    #?ResourceEntry dcterms:identifier ?AccessionNumber .
    #?ResourceEntry rdfs:seeAlso ?Entry .
}
limit 200

Component Class

Fromhttp://rdf.glytoucan.org
Tohttp://rdf.glytoucan.org/core

Instance URI property Class Instance URI Literal Individual
saccharide instance glycan:has_component   component instance    
component instance a glycan:component      
  glycan:has_cardinality     xsd:integer  
  glycan:has_monosaccharide   monosaccharide instance    
monosaccharide instance a glycan:monosaccharide      

INSERT query

log_enable(2,1);
sparql
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>
INSERT
{ GRAPH <http://rdf.glytoucan.org/core> {
  ?Saccharide glycan:has_component ?Component .
  ?Component a glycan:component .
  ?Component glycan:has_cardinality ?Cardinality .
  ?Component glycan:has_monosaccharide ?Monosaccharide .
  ?Monosaccharide a glycan:monosaccharide .
  }
}
USING <http://rdf.glytoucan.org>
WHERE {
    # Component 
    ?Saccharide a glycan:saccharide .
  ?Saccharide glycan:has_component ?Component .
  ?Component a glycan:component .
  ?Component glycan:has_cardinality ?Cardinality .
  ?Component glycan:has_monosaccharide ?Monosaccharide .
  ?Monosaccharide a glycan:monosaccharide .
};
checkpoint;
commit WORK;

Confirm query

PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>

SELECT *
#FROM <http://rdf.glytoucan.org>
FROM <http://rdf.glytoucan.org/core>
WHERE {
  # Saccharide
  ?Saccharide a glycan:saccharide .
  ?Saccharide glycan:has_component ?Component .
  ?Component a glycan:component .
  ?Component glycan:has_cardinality ?Cardinality .
  ?Component glycan:has_monosaccharide ?Monosaccharide.
  ?Monosaccharide a glycan:monosaccharide .
}
limit 200

Glycosequence Class

Fromhttp://rdf.glytoucan.org
Tohttp://rdf.glytoucan.org/sequence/glycoct

Instance URI property Class Instance URI Literal Individual
saccharide instance glycan:has_glycosequence   glycosequence instance    
glycosequence instance a glycosequence instance      
  glycan:has_sequence     GlycoCT string  
  glycan:in_carbohydrate_format       glycan:carbohydrate_format_glycoct
  rdfs:label     GlycoCT string  

INSERT query

log_enable(2,1);
sparql
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
INSERT
{ GRAPH <http://rdf.glytoucan.org/sequence/glycoct> {
    ?Saccharide glycan:has_glycosequence ?GSequence .
    ?GSequence glycan:has_sequence ?Sequence .
    ?GSequence glycan:in_carbohydrate_format ?Format .
    ?GSequence rdfs:label ?Sequence .
  }
}
USING <http://rdf.glytoucan.org>
WHERE {
    # Glycosequence
    ?Saccharide glycan:has_glycosequence ?GSequence .
    ?GSequence glycan:has_sequence ?Sequence .
    ?GSequence glycan:in_carbohydrate_format ?Format .
};
checkpoint;
commit WORK;

Confirm query

PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 

SELECT *
#SELECT COUNT(?label)
#SELECT COUNT(?Format)
#SELECT COUNT(?Sequence)
#SELECT COUNT(?GSequence)
#FROM <http://rdf.glytoucan.org>
FROM <http://rdf.glytoucan.org/sequence/glycoct> 
WHERE {
    # Glycosequence
    ?Saccharide glycan:has_glycosequence ?GSequence .
    ?GSequence glycan:has_sequence ?Sequence .
    ?GSequence glycan:in_carbohydrate_format ?Format .
    ?GSequence rdfs:label ?label .
}
limit 100

Image Class

Fromhttp://rdf.glytoucan.org
Tohttp://rdf.glytoucan.org/image

* GlyTouCanでは、RDFで記述されているImageのURIは利用していない
* JavascriptでイメージのURLを作っている
* とくに必要な場面は今のところ無いため、GRAPHは作らない
* 念のためにやり方を残す
Instance URI property Class Instance URI Literal Individual
saccharide instance glycan:has_image image instance      
image instance a glycan:image      
  dc:format     image/pingxsd:string  
  glycan:has_symbol_format       glycan:symbol_format_cfg
          glycan:symbol_format_uoxf
          glycan:symbol_format_text
          glycan:symbol_format_uoxf_color
          glycan:symbol_format_cfg_uoxf
          glycan:symbol_format_cfg_bw

INSERT query

log_enable(2,1);
sparql
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>
INSERT
{ GRAPH <http://rdf.glytoucan.org/image> {
  ?Saccharide glycan:has_image ?Image .
    ?Image a glycan:image .
    ?Image dc:format ?Format .
    ?Image glycan:has_symbol_format ?Symbol .
  }
}
FROM <http://rdf.glytoucan.org>
WHERE {
    # Image 
  ?Saccharide glycan:has_image ?Image .
    ?Image a glycan:image .
    ?Image dc:format ?Format .
    ?Image glycan:has_symbol_format ?Symbol .
}

Confirm query

PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>

SELECT *
#SELECT COUNT(?Symbol)
#SELECT COUNT(?Format)
#SELECT COUNT(?Image)
#FROM <http://rdf.glytoucan.org>
FROM <http://rdf.glytoucan.org/image/test> 
WHERE {
    # Image 
    #?Sacc glycan:has_image ?Image .
    #?Image a glycan:image .
    #?Image dc:format ?Format .
    #?Image glycan:has_symbol_format ?Symbol .

}
limit 100

Glycan motif Class

Fromhttp://rdf.glytoucan.org
Tohttp://rdf.glytoucan.org/motif

</motif>

追加

Instance URI property Class Instance URI Literal Individual
saccharide instance glycan:has_motif glycan motif instance      
glycan motif instance a glycan:glycan_moti      
  glycan:has_glycosequence   glycosequence instance    
  rdfs:label     “motif name”@en  
  glytoucan:is_reducing_end     boolean  

INSERT query

log_enable(2,1);
sparql
PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>

INSERT
{ GRAPH <http://rdf.glytoucan.org/motif> {
   # Motif
    ?Saccharide glycan:has_motif ?Motif .
    ?Motif a glycan:glycan_motif .
    ?Motif glycan:has_glycosequence ?GSequence .
    ?Motif rdfs:label ?MotifName .
    ?Motif glytoucan:is_reducing_end ?ReducingEnd .
  }
}
USING <http://rdf.glytoucan.org>
WHERE {
    # Motif
    ?Saccharide glycan:has_motif ?Motif .
    ?Motif a glycan:glycan_motif .
    ?Motif glycan:has_glycosequence ?GSequence .
    ?Motif rdfs:label ?MotifName .
    ?Motif glytoucan:is_reducing_end ?ReducingEnd .
};
checkpoint;
commit WORK;

Confirm query

PREFIX glycan: <http://purl.jp/bio/12/glyco/glycan#> 
PREFIX glytoucan:  <http://www.glytoucan.org/glyco/owl/glytoucan#>

SELECT *
#SELECT COUNT(?MotifName)
#SELECT COUNT(?GlycanMotifAlias)
#SELECT COUNT(?ReducingEnd)
#SELECT COUNT(?GSequence)
#SELECT COUNT(?GlycanMotif)
#FROM <http://rdf.glytoucan.org>
FROM <http://rdf.glytoucan.org/motif/test> 
WHERE {
    # Motif
    #?Saccharide glycan:has_motif ?GlycanMotif.
    #?GlycanMotif a glycan:glycan_motif .
    #?GlycanMotif glycan:has_glycosequence ?GSequence .
    #?GlycanMotif glytoucan:is_reducing_end ?ReducingEnd .
    #?GlycanMotif rdfs:label ?MotifName .
}
limit 100

Note