Difference between revisions of "Singleton Property"

From Knoesis wiki
Jump to: navigation, search
(Q3)
(Q4)
Line 187: Line 187:
  
 
=== Q4 ===
 
=== Q4 ===
 +
<pre>
 +
# Query 4:
 +
# ------------------------------------------------------------------
 +
# Time profiling for a given statement
 +
# ------------------------------------------------------------------
 +
 +
PREFIX bkr:      <http://mor.nlm.nih.gov/bkr/>
 +
PREFIX dc:      <http://purl.org/dc/elements/1.1/>
 +
PREFIX provenir: <http://knoesis.wright.edu/provenir/>
 +
PREFIX rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 +
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
 +
PREFIX umls:    <http://mor.nlm.nih.gov/umls/>
 +
PREFIX meta:    <http://mor.nlm.nih.gov/umls/META_>
 +
PREFIX sn:      <http://mor.nlm.nih.gov/umls/SEMNET_>
 +
SELECT count(*)
 +
FROM <http://mor.nlm.nih.gov/bkr_instances_sp>
 +
FROM <http://mor.nlm.nih.gov/bkr_metadata>
 +
WHERE {
 +
graph <http://mor.nlm.nih.gov/bkr_instances_sp> {
 +
meta:%s ?st_p_inst ?o .
 +
?st_p_inst rdf:type sn:%s . FILTER (?o = meta:%s) .
 +
?st_p_inst provenir:derives_from ?source_inst .
 +
?source_inst rdf:type ?source_cl .
 +
} .
 +
graph <http://mor.nlm.nih.gov/bkr_metadata> {
 +
?source_inst dc:date ?source_date .
 +
FILTER(?source_date >= xsd:date("%s") && ?source_date < xsd:date("%s"))
 +
}
 +
}
 +
</pre>
  
 
=== Q5 ===
 
=== Q5 ===

Revision as of 15:37, 9 October 2013

Singleton Property Resource Page

Singleton Property is a novel approach for making statements about statements in RDF without the use of RDF reification.

Datasets

We implemented the Singleton Property approach in two datasets: BKR and YAGO2S.

BKR

The BKR datasets are implemented using five approaches: the singleton property (SP), the standard RDF reification (R) and three flavors C1, C2 and C3 of the PaCE.
BKR-SP
BKR-R
BKR-C1
BKR-C2
BKR-C3

YAGO2S

We created the RDF-compliant version of YAGO2S using the singleton property approach. The file can be downloaded via yago2s-sp

Below is the complete set of generic properties and their singleton properties in the YAGO2S-SP.

Generic property                               	                                       Number of singleton property instances
http://yago-knowledge.org/resource/extractionSource                               	32598374
http://www.w3.org/1999/02/22-rdf-syntax-ns#type                                  	9019948
http://www.w3.org/2000/01/rdf-schema#label                                        	4200036
http://yago-knowledge.org/resource/isPreferredMeaningOf                           	2886014
http://www.w3.org/2004/02/skos/core#prefLabel                                     	2886010
http://yago-knowledge.org/resource/isLocatedIn                                    	1262563
http://yago-knowledge.org/resource/hasGender                                      	923364
http://yago-knowledge.org/resource/hasFamilyName                                  	838669
http://yago-knowledge.org/resource/hasGivenName                                   	827681
http://yago-knowledge.org/resource/wasBornOnDate                                  	804816
http://yago-knowledge.org/resource/wasCreatedOnDate                               	713167
http://yago-knowledge.org/resource/occursSince                                    	553116
http://yago-knowledge.org/resource/isAffiliatedTo                                 	497263
http://yago-knowledge.org/resource/playsFor                                       	412388
http://yago-knowledge.org/resource/hasLongitude                                   	393717
http://yago-knowledge.org/resource/hasLatitude                                    	393250
http://www.w3.org/2000/01/rdf-schema#subClassOf                                   	382532
http://yago-knowledge.org/resource/diedOnDate                                   	361443
http://yago-knowledge.org/resource/occursUntil                                    	337116
http://yago-knowledge.org/resource/created                                       	278455
http://yago-knowledge.org/resource/hasNumberOfPeople                              	230745
http://yago-knowledge.org/resource/hasWebsite                                    	226393
http://yago-knowledge.org/resource/wasBornIn                                      	218757
http://yago-knowledge.org/resource/happenedOnDate                                	208894
http://yago-knowledge.org/resource/happenedIn                                    	194161
http://yago-knowledge.org/resource/hasArea                                        	129920
http://yago-knowledge.org/resource/actedIn                                       	127513
http://yago-knowledge.org/resource/hasWordnetDomain                              	87104
http://yago-knowledge.org/resource/hasWonPrize                                    	73763
http://yago-knowledge.org/resource/byTransport                                    	55871
http://yago-knowledge.org/resource/hasDuration                                   	54741
http://yago-knowledge.org/resource/diedIn                                         	54174
http://yago-knowledge.org/resource/hasHeight                                      	50863
http://yago-knowledge.org/resource/isCitizenOf                                    	46060
http://yago-knowledge.org/resource/wasDestroyedOnDate                             	42966
http://yago-knowledge.org/resource/directed                                       	41811
http://yago-knowledge.org/resource/hasPopulationDensity                           	39408
http://yago-knowledge.org/resource/isConnectedTo                                  	33834
http://yago-knowledge.org/resource/livesIn                                        	33628
http://yago-knowledge.org/resource/hasMusicalRole                                 	32681
http://yago-knowledge.org/resource/graduatedFrom                                  	30389
http://yago-knowledge.org/resource/hasMotto                                      	27643
http://yago-knowledge.org/resource/owns                                           	26551
http://yago-knowledge.org/resource/isMarriedTo                                    	26325
http://yago-knowledge.org/resource/influences                                    	26306
http://yago-knowledge.org/resource/wroteMusicFor                                 	24294
http://yago-knowledge.org/resource/hasWeight                                     	21256
http://yago-knowledge.org/resource/hasPredecessor                                	20574
http://yago-knowledge.org/resource/hasSuccessor                                  	18005
http://yago-knowledge.org/resource/hasChild                                      	17695
http://yago-knowledge.org/resource/participatedIn                                	16833
http://yago-knowledge.org/resource/hasPages                                      	15616
http://yago-knowledge.org/resource/hasISBN                                       	10917
http://yago-knowledge.org/resource/isLeaderOf                                    	10700
http://yago-knowledge.org/resource/hasLength                                     	9010
http://yago-knowledge.org/resource/holdsPoliticalPosition                        	6029
http://yago-knowledge.org/resource/edited                                        	5946
http://yago-knowledge.org/resource/hasAirportCode                                	5715
http://yago-knowledge.org/resource/worksAt                                       	5134
http://yago-knowledge.org/resource/hasRevenue                                    	4114
http://yago-knowledge.org/resource/isPoliticianOf                                	3752
http://yago-knowledge.org/resource/hasAcademicAdvisor                            	3340
http://yago-knowledge.org/resource/hasCapital                                    	1937
http://yago-knowledge.org/resource/hasOfficialLanguage                           	964
http://yago-knowledge.org/resource/dealsWith                                     	947
http://yago-knowledge.org/resource/hasBudget                                     	717
http://yago-knowledge.org/resource/hasCurrency                                   	667
http://yago-knowledge.org/resource/exports                                       	579
http://yago-knowledge.org/resource/isKnownFor                                    	500
http://yago-knowledge.org/resource/isInterestedIn                                	465
http://yago-knowledge.org/resource/imports                                        	391
http://yago-knowledge.org/resource/hasTLD                                       	270
http://yago-knowledge.org/resource/hasGDP                                        	241
http://yago-knowledge.org/resource/hasExport                                      	175
http://yago-knowledge.org/resource/hasExpenses                                    	174
http://yago-knowledge.org/resource/hasImport                                      	172
http://yago-knowledge.org/resource/hasInflation                                   	155
http://yago-knowledge.org/resource/hasUnemployment                               	145
http://yago-knowledge.org/resource/hasEconomicGrowth                              	141
http://yago-knowledge.org/resource/hasGini                                        	130
http://yago-knowledge.org/resource/hasPoverty                                     	84
http://yago-knowledge.org/resource/hasImdb                                        	9
http://yago-knowledge.org/resource/startedOnDate                                  	8

Query Set A

Four sets of queries for R, C1, C2, and C3 are obtained from ProvenanceContextEntity We created an equivalent set of queries for SP approach as the following.

Q1

# Query 1:
# ------------------------------------------------------------------
# 	All statements for a given PMID (e.g., 17209178)
# ------------------------------------------------------------------
PREFIX bkr:      <http://mor.nlm.nih.gov/bkr/>
PREFIX dc:       <http://purl.org/dc/elements/1.1/>
PREFIX provenir: <http://knoesis.wright.edu/provenir/>
PREFIX rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
PREFIX umls:     <http://mor.nlm.nih.gov/umls/>
PREFIX meta:     <http://mor.nlm.nih.gov/umls/META_>
PREFIX sn:       <http://mor.nlm.nih.gov/umls/SEMNET_>
SELECT ?st_s_inst ?st_p_inst ?st_o_inst
FROM <http://mor.nlm.nih.gov/bkr_instances_sp>
WHERE {
	?st_s_inst ?st_p_inst ?st_o_inst .
	?st_p_inst provenir:derives_from bkr:PUBMED_99992-INST .		
}

Q2

# Query 2: C0012963|STIMULATES|C0598981|2006-12-01|2008-12-01
# ------------------------------------------------------------------
# 	All sources for a given statement
# 	(Lipoproteins  AFFECTS  Inflammatory cell)
# ------------------------------------------------------------------
PREFIX bkr:      <http://mor.nlm.nih.gov/bkr/>
PREFIX dc:       <http://purl.org/dc/elements/1.1/>
PREFIX provenir: <http://knoesis.wright.edu/provenir/>
PREFIX rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
PREFIX umls:     <http://mor.nlm.nih.gov/umls/>
PREFIX meta:     <http://mor.nlm.nih.gov/umls/META_>
PREFIX sn:       <http://mor.nlm.nih.gov/umls/SEMNET_>
SELECT ?source_inst
FROM <http://mor.nlm.nih.gov/bkr_instances_sp>
WHERE {
	meta:C0012963 ?st_p_inst meta:C0598981 .
	?st_p_inst rdf:type sn:STIMULATES .
	?st_p_inst provenir:derives_from ?source_inst .		
}

Q3

# Query 3:
# ------------------------------------------------------------------
# 	Frequency by source for 1 statement
# ------------------------------------------------------------------
PREFIX bkr:      <http://mor.nlm.nih.gov/bkr/>
PREFIX dc:       <http://purl.org/dc/elements/1.1/>
PREFIX provenir: <http://knoesis.wright.edu/provenir/>
PREFIX rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
PREFIX umls:     <http://mor.nlm.nih.gov/umls/>
PREFIX meta:     <http://mor.nlm.nih.gov/umls/META_>
PREFIX sn:       <http://mor.nlm.nih.gov/umls/SEMNET_>
SELECT ?source_name count(?source_name)
FROM <http://mor.nlm.nih.gov/bkr_instances_sp>
FROM <http://mor.nlm.nih.gov/bkr_schema>
WHERE {
	graph <http://mor.nlm.nih.gov/bkr_instances_sp> {
		meta:C0006307 ?st_p_inst ?o .
		?st_p_inst rdf:type sn:TREATS .
		?st_p_inst provenir:derives_from ?source_inst .
		?source_inst rdf:type ?source_cl .
	} .
	graph <http://mor.nlm.nih.gov/bkr_schema> {
		?source_cl rdfs:label ?source_name .
	} .
}

Q4

# Query 4:
# ------------------------------------------------------------------
# 	Time profiling for a given statement
# ------------------------------------------------------------------

PREFIX bkr:      <http://mor.nlm.nih.gov/bkr/>
PREFIX dc:       <http://purl.org/dc/elements/1.1/>
PREFIX provenir: <http://knoesis.wright.edu/provenir/>
PREFIX rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
PREFIX umls:     <http://mor.nlm.nih.gov/umls/>
PREFIX meta:     <http://mor.nlm.nih.gov/umls/META_>
PREFIX sn:       <http://mor.nlm.nih.gov/umls/SEMNET_>
SELECT count(*)
FROM <http://mor.nlm.nih.gov/bkr_instances_sp>
FROM <http://mor.nlm.nih.gov/bkr_metadata>
WHERE {
	graph <http://mor.nlm.nih.gov/bkr_instances_sp> {
		meta:%s ?st_p_inst ?o .
		?st_p_inst rdf:type sn:%s . FILTER (?o = meta:%s) .
		?st_p_inst provenir:derives_from ?source_inst .
		?source_inst rdf:type ?source_cl .
	} .
	graph <http://mor.nlm.nih.gov/bkr_metadata> {
		?source_inst dc:date ?source_date .
		FILTER(?source_date >= xsd:date("%s") && ?source_date < xsd:date("%s"))
	}
}

Q5

Query Set B

We created five equivalent sets of SPARQL queries for SP approach as the following.

Q1

Q1 - SP

Q1 - R

Q1 - C1

Q1 - C2

Q1 - C3

Q2

Q2 - SP

Q2 - R

Q2 - C1

Q2 - C2

Q2 - C3

Q3

Q3 - SP

Q3 - R

Q3 - C1

Q3 - C2

Q3 - C3

Q5

OWL 2 Compatibility


@prefix : <http://nlm.nih.gov/mesh/> . 
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . 
@prefix owl: <http://www.w3.org/2002/07/owl#> . 
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 

:Descriptor1 :co-occurs-1234 :Descriptor2 . 
:co-occurs-1234 :createdBy :Vinh . 
:co-occurs-1234 rdf:singletonPropertyOf  :co-occurs . 
rdf:singletonPropertyOf rdfs:subPropertyOf rdf:type . 
 
:Descriptor rdf:type owl:Class . 
:User rdf:type owl:Class . 
:co-occurs rdf:type owl:Class . 
:co-occurs rdf:type owl:ObjectProperty . 
:createdBy rdf:type  owl:ObjectProperty . 

:Descriptor1 rdf:type :Descriptor . 
:Descriptor2 rdf:type :Descriptor . 
:Vinh rdf:type  :User . 

:co-occurs-1234 rdf:type owl:ObjectProperty . 
:co-occurs-1234 rdf:type  :co-occurs .