Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove RDF4J from TRS Client and use Lyo Store instead #388

Merged
berezovskyi merged 31 commits intomasterfrom
b-remove-rdf4j
Feb 14, 2026
Merged

Remove RDF4J from TRS Client and use Lyo Store instead #388
berezovskyi merged 31 commits intomasterfrom
b-remove-rdf4j

Conversation

@berezovskyi
Copy link
Contributor

Description

  1. Replaces the RDF4J dependency in TRS Client with Lyo Store.
  2. Adds Store.rawUpdateQuery() method.

Needs testing.

Checklist

  • This PR adds an entry to the CHANGELOG. See https://keepachangelog.com/en/1.0.0/ for instructions. Minor edits are exempt.
  • This PR was tested on at least one Lyo OSLC server (e.g. manual workflow on Lyo Sample and OSLC RefImpl) or adds unit/integration tests.
  • This PR does NOT break the API

Issues

Closes #0; Closes #00

(use exactly this syntax to link to issues, one issue per statement only!)

@berezovskyi
Copy link
Contributor Author

@Jad-el-khoury I quite forgot about this PR I developed. Maybe you can start with that?

@berezovskyi berezovskyi marked this pull request as ready for review November 6, 2023 20:04
@berezovskyi berezovskyi requested review from Jad-el-khoury and jadelkhoury and removed request for jadelkhoury November 6, 2023 20:04
Signed-off-by: Andrew Berezovskyi <[email protected]>
Copilot AI review requested due to automatic review settings December 13, 2025 16:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@berezovskyi berezovskyi changed the title feat: use Lyo Store in TRS Client feat: Remove RDF4J from TRS Client and use Lyo Store instead Dec 13, 2025
@berezovskyi berezovskyi changed the title feat: Remove RDF4J from TRS Client and use Lyo Store instead Remove RDF4J from TRS Client and use Lyo Store instead Dec 13, 2025
@berezovskyi
Copy link
Contributor Author

@oslc-bot /test-all

@oslc-bot
Copy link

oslc-bot commented Dec 22, 2025

Downstream Build Status

Repository Lyo CI Job state Workflow
oslc-op/refimpl ✅ Pass completed Link
oslc/lyo-samples ✅ Pass completed Link
oslc/promcode-lyo-server ✅ Pass completed Link

@berezovskyi berezovskyi self-assigned this Feb 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 21 comments.

Comment on lines +46 to +47
} catch (StoreAccessException e) {
throw new RuntimeException(e);
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling here wraps StoreAccessException in RuntimeException, which may hide useful error information and make it harder for callers to handle specific SPARQL errors. Consider either propagating the StoreAccessException (by declaring it in the method signature) or logging more context about the failure before wrapping it.

Copilot uses AI. Check for mistakes.
}

/**
* For a modification event return a sparql update relfecting the change
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "relfecting" should be "reflecting".

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +43
// TODO: build one or use a pool
Store store =
StoreFactory.sparql(
null, sparqlUpdateService, sparql_baseAuth_userName, sparql_baseAuth_pwd);
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new Store instance on every finishCycle call can lead to performance and resource issues. The TODO comment acknowledges this ("build one or use a pool"), but the current implementation will create excessive connections if finishCycle is called frequently. Consider: (1) Reusing a single Store instance as a class field, or (2) Implementing a connection pool, or (3) Using dependency injection to provide the Store instance. This is especially important for high-frequency TRS synchronization scenarios.

Copilot uses AI. Check for mistakes.
}

/**
* For a modification event target return a sparql update relfecting the
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "relfecting" should be "reflecting".

Copilot uses AI. Check for mistakes.
Comment on lines +616 to +633
* Create a sparql update ading the triples to the named graph with the
* specified name and send it to the sparql update endpoint specified using
* the given repo connection object. Uses the sesame libraries
*
* @param conn
* sesame repo connection object
* @param triples
* triples to be added to the named graph
* @param graphName
* named graph to which the triples shall be added
*/
// public void processTripleAdditionQuery(RepositoryConnection conn, String triples, String
// graphName) {
// String addTriplesToGraphQuery = SparqlUtil.addTriplesToGraphQuery(graphName, triples);
// SparqlUtil.processQuery_sesame(addTriplesToGraphQuery, conn);
// }

/**
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large blocks of commented-out RDF4J/Sesame code (lines 432-631) should be removed entirely rather than left as comments. Since this is a migration away from RDF4J, keeping this deprecated code in comments reduces code clarity and maintainability. The code history is preserved in version control, so there's no need to keep these comments. This is especially important given that line 472 contains hardcoded credentials.

Suggested change
* Create a sparql update ading the triples to the named graph with the
* specified name and send it to the sparql update endpoint specified using
* the given repo connection object. Uses the sesame libraries
*
* @param conn
* sesame repo connection object
* @param triples
* triples to be added to the named graph
* @param graphName
* named graph to which the triples shall be added
*/
// public void processTripleAdditionQuery(RepositoryConnection conn, String triples, String
// graphName) {
// String addTriplesToGraphQuery = SparqlUtil.addTriplesToGraphQuery(graphName, triples);
// SparqlUtil.processQuery_sesame(addTriplesToGraphQuery, conn);
// }
/**

Copilot uses AI. Check for mistakes.
berezovskyi and others added 2 commits February 14, 2026 15:39
Signed-off-by: Andrew Berezovskyi <[email protected]>
@berezovskyi berezovskyi merged commit 13c6408 into master Feb 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants