Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling of getComponent function when no literal values are found on an object that's an IRI #8

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlin.code.style=official
projectVersion=0.3.0
projectVersion=0.4.0
log4jVersion=2.20.0
kotlinxSerializationJsonVersion=1.5.1
jenaVersion=4.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ class CompoundName(private val graph: Graph, private var componentQueue: List<No
val value = result[0]

if (value.`object`.isURI) {
return getComponentLiteral(value.`object`)
try {
return getComponentLiteral(value.`object`)
}
catch (_: Exception) {
// Catch the exception thrown when no rdf:value is found on value.object.
// Use this as the value instead.
// Applications using this function will need to check whether any componentValue values are IRIs and
// handle it by deriving the label for the object in some other way.
}
}

val componentTypes = graph.find(focusNode, additionalType, Node.ANY).toList()
Expand Down