Skip to content

Instantly share code, notes, and snippets.

@crapthings
Last active May 16, 2020
Embed
What would you like to do?
sparql 查询 cheatsheet

LKIF Core PREFIX

PREFIX : <http://www.estrellaproject.org/lkif-core/lkif-extended.owl#>

PREFIX top: <http://www.estrellaproject.org/lkif-core/lkif-top.owl#>
PREFIX place: <http://www.estrellaproject.org/lkif-core/relative-places.owl#>
PREFIX mereology: <http://www.estrellaproject.org/lkif-core/mereology.owl#>
PREFIX time: <http://www.estrellaproject.org/lkif-core/time.owl#>

PREFIX process: <http://www.estrellaproject.org/lkif-core/process.owl#>
PREFIX role: <http://www.estrellaproject.org/lkif-core/role.owl#>
PREFIX action: <http://www.estrellaproject.org/lkif-core/action.owl#>
PREFIX expression: <http://www.estrellaproject.org/lkif-core/expression.owl#>

PREFIX legal-action: <http://www.estrellaproject.org/lkif-core/legal-action.owl#>
PREFIX legal-role: <http://www.estrellaproject.org/lkif-core/legal-role.owl#>
PREFIX norm: <http://www.estrellaproject.org/lkif-core/norm.owl#>

PREFIX modification: <http://www.estrellaproject.org/lkif-core/time-modification.owl#>
PREFIX rules: <http://www.estrellaproject.org/lkif-core/lkif-rules.owl#>

查看有多少被定义的类

SELECT DISTINCT ?实体名称
WHERE {
  ?实体名称 a owl:Class .
}

查看有多少类和类之间的联系

SELECT ?实体名称 ?关系 ?相关实体
WHERE {
  ?实体名称 a owl:Class;
  	?关系 ?相关实体 .
  FILTER (
    ?关系 NOT IN (rdfs:comment, rdf:type)
  )
}

查看有多少类和类之间的联系

SELECT ?实体名称 ?关系 ?相关实体
WHERE {
  ?实体名称 a owl:Class;
  	?关系 ?相关实体 .
  FILTER (
    ?关系 NOT IN (rdfs:comment, rdf:type)
  )
}
SELECT *
WHERE {
  ?事务 process:requirement ?主张类型 .
  ?主张类型 ?合规关系 ?被允许的事物 .
  ?被允许的事物 ?权限关系 ?权限 .
  ?权限 ?角色关系 ?角色结果 .
  ?角色结果 ?Agent ?z
  FILTER (?Agent NOT IN (rdf:type))
}

查询测试

SELECT ?审批人 ?角色 ?权限 ?主张
WHERE {
	?意图关联主张 rdf:type owl:ObjectProperty .
	?权限关联角色 rdf:type owl:ObjectProperty .
	?角色关联施事 rdf:type owl:ObjectProperty .
	?意图 ?意图关联主张 ?主张 .
	?主张 norm:allowed_by ?权限 .
	?权限 a :Extended_Permission .
	?权限 ?权限关联角色 ?角色 .
	?角色 ?角色关联施事 ?审批人 .
	?审批人 a action:Agent .
}

关系

SELECT *
WHERE {
	?s rdf:type owl:ObjectProperty .
}
action:actor	
action:actor_in	
mereology:direct_part	
mereology:member	
mereology:part	
process:creation	
process:participant	
process:participant_in	
process:result_of	
expression:addressee	
expression:asserted_by	
expression:asserts	
expression:attitude	
expression:author	
expression:bears	
expression:believed_by	
expression:believes	
expression:declared_by	
expression:declares	
expression:evaluated_by	
expression:evaluates	
expression:evaluatively_comparable	
expression:held_by	
expression:holds	
expression:intended_by	
expression:intends	
expression:medium	
expression:observer	
expression:observes	
expression:promised_by	
expression:promises	
expression:qualified_by	
expression:qualifies	
expression:qualitatively_comparable	
expression:stated_by	
expression:states	
expression:towards	
expression:utterer	
expression:utters	
role:counts_as	
role:imposed_on	
role:played_by	
role:plays	
mereology:strict_part_of	
norm:allowed_by	
norm:allows	
process:requirement_of	
rules:applies	
rules:excluded	
rules:prior	
rules:rebuts	
rules:rule_predicate	
mereology:component	
mereology:component_of	
mereology:composed_of	
mereology:composes	
mereology:contained_in	
mereology:contains	
mereology:direct_part_of	
mereology:member_of	
mereology:part_of	
mereology:strict_part	
norm:commanded_by	
norm:commands	
norm:disallowed_by	
norm:disallows	
norm:normatively_comparable	
norm:normatively_equivalent_or_better	
norm:normatively_equivalent_or_worse	
norm:normatively_not_equivalent	
norm:normatively_strictly_better	
norm:normatively_strictly_worse	
norm:strictly_equivalent	
process:created_by	
process:requirement	
process:resource	
process:resource_for	
process:result	
place:abut	
place:connect	
place:cover	
place:covered_by	
place:exactly_coincide	
place:externally_connect	
place:in	
place:location_complex	
place:location_complex_for	
place:meet	
place:overlap	
place:partially_coincide	
place:relatively_fixed	
place:spatial_reference	
place:spatial_relation	
role:context	
modification:application	
modification:duration	
modification:efficacy	
modification:final_date	
modification:final_date_of	
modification:in_force	
modification:initial_date	
modification:initial_date_of	
modification:produce_efficacy_modification	
modification:produce_inforce_modification	
modification:produce_textual_modification	
time:finishes	
time:starts	
time:temporal_relation	
time:after	
time:before	
time:between	
time:during	
time:immediately_after	
time:immediately_before	
time:overlap	
time:preceeds

SELECT *
WHERE {
	?s rdf:type owl:Class .
}
owl:Thing 
owl:Nothing
action:Action 
action:Agent  
action:Artifact 
action:Collaborative_Plan 
action:Creation 
action:Natural_Object 
action:Organisation 
action:Person 
action:Personal_Plan  
action:Plan 
action:Reaction 
action:Trade  
action:Transaction  
top:Mental_Object 
process:Change  
process:Physical_Object 
process:Process 
expression:Argument 
expression:Assertion  
expression:Assumption 
expression:Belief 
expression:Cause  
expression:Communicated_Attitude  
expression:Declaration  
expression:Desire 
expression:Document 
expression:Evaluative_Attitude  
expression:Evaluative_Proposition 
expression:Evidence 
expression:Exception  
expression:Expectation  
expression:Expression 
expression:Fact 
expression:Intention  
expression:Lie  
expression:Medium 
expression:Observation  
expression:Problem  
expression:Promise  
expression:Proposition  
expression:Propositional_Attitude 
expression:Qualification  
expression:Qualified  
expression:Reason 
expression:Speech_Act 
expression:Statement_In_Writing 
expression:Surprise 
top:Mental_Entity 
role:Epistemic_Role 
legal-action:Act_of_Law 
legal-action:Assignment 
legal-action:Association  
legal-action:Co-operative 
legal-action:Company  
legal-action:Corporation  
legal-action:Decision 
legal-action:Delegation 
legal-action:Foundation 
legal-action:Incorporated 
legal-action:Legal_Person 
legal-action:Legal_Speech_Act 
legal-action:Legislative_Body 
legal-action:Limited_Company  
legal-action:Mandate  
legal-action:Natural_Person 
legal-action:Private_Legal_Person 
legal-action:Public_Act 
legal-action:Public_Body  
legal-action:Public_Limited_Company 
legal-action:Society  
legal-action:Unincorporated 
legal-role:Legal_Role 
legal-role:Professional_Legal_Role  
legal-role:Social_Legal_Role  
role:Function 
role:Organisation_Role  
role:Role 
role:Social_Role  
norm:Permission 
rules:Argument  
rules:Assumption  
rules:Atom  
rules:Exception 
rules:Negated_Atom  
rules:Rule  
rules:Valid_Rule  
mereology:Atom  
mereology:Composition 
top:Abstract_Entity 
top:Occurrence  
top:Physical_Entity 
top:Spatio_Temporal_Occurrence  
mereology:Pair  
mereology:Part  
mereology:Whole 
norm:Action_Power 
norm:Allowed  
norm:Allowed_And_Disallowed 
norm:Belief_In_Violation  
norm:Code 
norm:Code_of_Conduct  
norm:Contract 
norm:Custom 
norm:Customary_Law  
norm:Declarative_Power  
norm:Decree 
norm:Definitional_Expression  
norm:Directive  
norm:Disallowed 
norm:Disallowed_Intention 
norm:Enabling_Power 
norm:Evaluative_Expression  
norm:Exclusionary_Right 
norm:Existential_Expression 
norm:Hohfeldian_Power 
norm:Immunity 
norm:International_Agreement  
norm:International_Arbitration  
norm:Legal_Doctrine 
norm:Legal_Document 
norm:Legal_Expression 
norm:Legal_Source 
norm:Liability_Right  
norm:Liberty_Right  
norm:Mandatory_Precedent  
norm:Non-binding_International_Agreement  
norm:Norm 
norm:Normatively_Qualified  
norm:Obligation 
norm:Obligative_Right 
norm:Obliged  
norm:Observation_of_Violation 
norm:Permissive_Right 
norm:Persuasive_Precedent 
norm:Potestative_Expression 
norm:Potestative_Right  
norm:Precedent  
norm:Proclamation 
norm:Prohibition  
norm:Qualificatory_Expression 
norm:Regulation 
norm:Resolution 
norm:Right  
norm:Soft_Law 
norm:Statute  
norm:Strictly_Allowed 
norm:Strictly_Disallowed  
norm:Treaty 
process:Continuation  
process:Initiation  
process:Mental_Process  
process:Physical_Process  
process:Termination 
time:Temporal_Occurrence  
place:Absolute_Place  
place:Comprehensive_Place 
place:Location_Complex  
place:Place 
place:Relative_Place  
role:Person_Role  
role:Subjective_Entity  
modification:Annulment  
modification:Application  
modification:Application_Date 
modification:Application_Interval 
modification:Delivery_Date  
modification:Deregulation 
modification:Dynamic_Temporal_Entity  
modification:Efficacy_Interval  
modification:Efficacy_Modification  
modification:End_efficacy 
modification:End_in_Force 
modification:Enter_in_Force_Date  
modification:Exception  
modification:Existence_Date 
modification:Extension  
modification:In_Force_Interval  
modification:In_Force_Modification  
modification:Integration  
modification:Interpretation 
modification:Modification 
modification:Modification_of_Meaning  
modification:Modification_of_Scope  
modification:Modification_of_System 
modification:Modification_of_Term 
modification:Prorogation_Efficacy 
modification:Prorogation_in_Force 
modification:Publication_Date 
modification:Ratification 
modification:Relocation 
modification:Remaking 
modification:Renewal  
modification:Repeal 
modification:Retroactivity  
modification:Semantic_Annotation  
modification:Start_Efficacy 
modification:Start_in_Force 
modification:Static_Temporal_Entity 
modification:Substitution 
modification:Suspension 
modification:Temporal_Modification  
modification:Textual_Modification 
modification:Transposition  
modification:Ultractivity 
modification:Variation  
time:Interval 
time:Moment 
time:Pair_Of_Periods  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment