# BASE <https://raw.githubusercontent.com/SuLab/Genewiki-ShEx/master/proteins/Wikidata-human-proteins.shex>
# Shape Expression for Human proteins in Wikidata

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX prv: <http://www.wikidata.org/prop/reference/value/>
PREFIX pr:  <http://www.wikidata.org/prop/reference/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX interpro: <http://micel.io/genewiki/interpro/>

start = @<#wikidata-human-protein>

# wikidata-human protein is the main shape for a human protein data model in Wikidata. Each line between the brackets
# represents the structure that can be enforced to validate human protein annotations in Wikidata
#
# We distinguish between value statements, identifier statements, and erronuous statements.
# Value statements contain either actual values, or pointers to other Wikidata items. Identifier statements capture
# external identifiers, erronuous statements are those that are errors.
#

<#wikidata-human-protein> {
	# STATEMENTS
	p:P31 @<#P31_instance_of> ;
	p:P361 @<#P361_part_of>* ;
	p:P527 @<#P527_has_part>* ;
	p:P680 @<#P680_molecular_function>* ;
	p:P681 @<#P681_cell_component>* ;
	p:P682 @<#P682_biological_process>* ;
	p:P702 @<#P702_encoded_by> ;
	p:P703 @<#P703_found_in_taxon_human> ;
	p:P1910 @<#P1910_decreased_expression_in>* ;

	# IDENTIFIERS
	p:P352 @<#P352_uniprot_id>+ ;
	p:P705 @<#P705_ensembl_protein_id>* ;
	p:P637 @<#P637_RefSeq_Protein_ID>* ; 
    p:P639 @<#P639_RefSeq_RNA_ID>* ; # Currently, we decided to model this, but change in the future if we find a more acurate representation

}

# Shape expressions for Wikidata statements

<#P31_instance_of> {
	ps:P31 [wd:Q8054] ;
	prov:wasDerivedFrom @<#protein_reference>;
}
 
<#P352_uniprot_id> {
	ps:P352 LITERAL ;
	prov:wasDerivedFrom IRI;
}

<#P361_part_of> {
	ps:P361 IRI ;
	prov:wasDerivedFrom @<#interpro_reference>;
}

<#P527_has_part> {
	ps:P527 IRI ;
	prov:wasDerivedFrom IRI;
}

<#P637_RefSeq_Protein_ID> {
	ps:P637 LITERAL ;
	prov:wasDerivedFrom IRI;
}

<#P680_molecular_function> {
	ps:P680 @<#molecular_function> ;
	pq:P459 @<#determination_method>+ ;
	prov:wasDerivedFrom IRI+;
}
<#P681_cell_component> {
	ps:P681 @<#cell_component> ;
	pq:P459 @<#determination_method>+ ;
	prov:wasDerivedFrom IRI+;
}
<#P682_biological_process> {
	ps:P682 @<#biological_process> ;
	pq:P459 @<#determination_method>+ ;
	prov:wasDerivedFrom IRI+;
}

<#P639_RefSeq_RNA_ID> {
	ps:P637 LITERAL ;
	prov:wasDerivedFrom IRI;
}

<#molecular_function> {
    p:P31{
    	ps:P31   [wd:Q14860489]
    }
}

<#cell_component> {
    p:P31{
    	ps:P31   [wd:Q5058355]
    }
}
<#biological_process> {
    p:P31{
    	ps:P31   [wd:Q2996394]
    }
}

<#determination_method> [
  wd:Q23174122	
wd:Q23174671	
wd:Q23174952	
wd:Q23175558	
wd:Q23190827	
wd:Q23190853	
wd:Q23190881	
wd:Q23173789	
wd:Q23174389	
wd:Q23190854	
wd:Q23190856	
wd:Q23190842	
wd:Q23175251	
wd:Q23190637	
wd:Q23190825	
wd:Q23190738	
wd:Q23190852	
wd:Q23190857	
wd:Q23190850	
wd:Q23190826
]

<#P702_encoded_by> {	
     ps:P702 @<#human_gene> ;
	 prov:wasDerivedFrom IRI+ 
} 

<#P703_found_in_taxon_human> {	
     ps:P703 [wd:Q15978631] ;
	 prov:wasDerivedFrom IRI+ 
}

<#P1910_decreased_expression_in> {
	ps:P1910 @<#disease> ;
	pq:P459 @<#determination_method> ;
	prov:wasDerivedFrom IRI+
} 

<#disease> {
	wdt:P699 LITERAL ;
}

# Identifiers
<#P705_ensembl_protein_id> {
	ps:P705 LITERAL ;
	prov:wasDerivedFrom IRI ;
}


# REFERENCES
<#protein_reference> {}

#<#protein_reference> @<#uniprot_reference> OR  
#	@<#literature_reference> 

<#uniprot_reference> {
	pr:P248	[
	    wd:Q905695
	    wd:Q58943792 
	    wd:Q28018111
	] ;
	pr:P352	LITERAL ;
	pr:P813	xsd:dateTime ;
	pr:P854 IRI? ;
	pr:P1640 wd:Q905695? ;
}

<#interpro_reference> {
	pr:P248	@<#interpro_release> ;
	pr:P854 IRI ;
}

<#literature_reference> {
	pr:P248 @<#wikicite> ;
	pr:P813 xsd:dateTime ;
	pr:P854 IRI ;
}

<#wikicite> {
	wdt:P31 [wd:Q13442814] ;
}

<#interpro_release> {
	p:P629 {
		ps:P629	[
		  wd:Q3047275
		  wd:Q58943792
		  wd:Q3331189
		] ;
	}
}

# Subgraphs
<#human_gene> {
	p:P31 {
		ps:P31 [wd:Q7187]
	}
}
