Add n10s.inference.isTypeRel UDF to check relationship type hierarchy (#271)#355
Open
jexp wants to merge 2 commits into
Open
Add n10s.inference.isTypeRel UDF to check relationship type hierarchy (#271)#355jexp wants to merge 2 commits into
jexp wants to merge 2 commits into
Conversation
New user function analogous to hasLabel but for relationship types: checks whether a relationship is explicitly or implicitly of the given type by traversing the RDFS property hierarchy (rdfs:subPropertyOf). Closes #271
…oc and reference.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
n10s.inference.isTypeRel(rel, relTypeName, params)user function toMicroReasoners.javan10s.inference.hasLabelbut operates on relationship types instead of node labelsrdfs:subPropertyOf)Function Signature
Parameters:
rel— the relationship to checkrelTypeName— the target relationship type name to test againstparams(optional) — override graph config settings inline:relLabel,subRelRel,relNamePropBehaviour:
trueimmediately if the relationship's actual type equalsrelTypeName(exact match, no graph traversal needed)subPropertyOfpath from the actual type up torelTypeNameMicroReasonerExceptionif neither a GraphConfig nor inline params are providedTest Coverage
Three new tests added to
MicroReasonersTest.java(19 inference tests pass total):testIsTypeRelNoOntotestIsTypeRelACTS_IN→WORKS_IN) with inline paramstestIsTypeRelWithGraphConfigDocs
Added to
inference.adoc: new=== n10s.inference.isTypeRelsection at the end of the "Hierarchies of Relationships" chapter. Includes a full movie-database example showing aWHEREclause filter that matchesACTED_INandDIRECTEDrelationships as implicitWORKED_IN, and a note about theMicroReasonerExceptionwhen neither a GraphConfig nor inline params are provided.Updated
reference.adoc: addedn10s.inference.isTypeRelto the Inferencing functions table, renamed the parameters section to cover bothgetRelsandisTypeRel, and added a note thatrelDirisgetRels-only.Closes #271