Skip to content

Commit

Permalink
Debugging duplicate relations case.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-brandizi committed Aug 28, 2023
1 parent 0d8f0fd commit f672519
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public void accept ( Set<QuerySolution> relRecords )

// TODO: remove, debug
int relOndexId = Optional.ofNullable ( pgRelation.getProperties ().get ( "ondexId" ) )
.map ( pv -> ((Set<Object>) pv) )
.filter ( pvset -> !pvset.isEmpty () )
.map ( pvset -> pvset.iterator ().next () )
.map ( String::valueOf )
.map ( Integer::valueOf )
.orElse ( -1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ public String getPGId ( RDFNode node, Function<String, String> idConverter )
* It doesn't do anything if the query is null.
*
*/
protected void addPGProps ( PGEntity cyEnt, String propsSparql )
protected void addPGProps ( PGEntity pgEntity, String propsSparql )
{
ensureOpen ();
Dataset dataSet = this.getDataSet ();

QuerySolutionMap params = new QuerySolutionMap ();
params.add ( "iri", dataSet.getUnionModel().getResource ( cyEnt.getIri () ) );
params.add ( "iri", dataSet.getUnionModel().getResource ( pgEntity.getIri () ) );

// It may be omitted, if you don't have any property except the IRI.
if ( propsSparql == null ) return;
Expand All @@ -143,11 +143,11 @@ protected void addPGProps ( PGEntity cyEnt, String propsSparql )
{
String propName = this.getPGId ( row.get ( "name" ), propIdConverter );
if ( propName == null ) throw new IllegalArgumentException (
"Null property name for " + cyEnt.getIri ()
"Null property name for " + pgEntity.getIri ()
);

String propValue = JENAUTILS.literal2Value ( row.getLiteral ( "value" ) ).get ();
cyEnt.addPropValue ( propName, propValue );
pgEntity.addPropValue ( propName, propValue );
},
params
);
Expand Down

0 comments on commit f672519

Please sign in to comment.