Skip to content

Commit 536e19d

Browse files
committed
Merge branch 'release/3.6.0' into develop
2 parents 77ef295 + 95903ee commit 536e19d

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

silk-plugins/silk-plugins-csv/src/main/scala/org/silkframework/plugins/dataset/csv/CsvDatasetTrait.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ trait CsvDatasetTrait {
3232
val separatorChar: Char =
3333
if (separator == "\\t") { '\t' }
3434
else if (separator.length == 1) { separator.head }
35+
else if(separator.isEmpty) { ',' }
3536
else { throw new IllegalArgumentException(s"Invalid separator: '$separator'. Must be a single character.") }
3637

3738
val arraySeparatorChar: Option[Char] =

silk-react-components/src/HierarchicalMapping/elements/RuleTitle.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { NotAvailable } from '@eccenca/gui-elements';
44
import { ThingName } from '../components/ThingName';
55

66
import {
7-
MAPPING_RULE_TYPE_ROOT,
7+
MAPPING_RULE_TYPE_COMPLEX_URI,
8+
MAPPING_RULE_TYPE_ROOT, MAPPING_RULE_TYPE_URI,
89
} from '../utils/constants';
910
import { MAPPING_RULE_TYPE_COMPLEX, MAPPING_RULE_TYPE_DIRECT, MAPPING_RULE_TYPE_OBJECT } from '../utils/constants';
1011

@@ -35,7 +36,12 @@ const RuleTitle = ({ rule, ...otherProps }) => {
3536
) : (
3637
<NotAvailable />
3738
);
39+
case MAPPING_RULE_TYPE_URI:
40+
case MAPPING_RULE_TYPE_COMPLEX_URI:
41+
return <span>uri</span>
3842
}
43+
44+
return <NotAvailable />;
3945
};
4046

4147
export default RuleTitle;

silk-workbench/silk-workbench-workspace/app/controllers/workspaceApi/search/ItemTypeFacetCollector.scala

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import org.silkframework.rule.{LinkSpec, TransformSpec}
88
import org.silkframework.workspace.activity.workflow.Workflow
99
import org.silkframework.workspace.{Project, ProjectTask}
1010

11+
import java.util.concurrent.ConcurrentHashMap
12+
import java.util.logging.Logger
1113
import scala.collection.immutable.ListMap
1214
import scala.collection.mutable
1315
import scala.reflect.ClassTag
@@ -42,6 +44,9 @@ trait ItemTypeFacetCollector[T <: TaskSpec] {
4244
}
4345

4446
object ItemTypeFacetCollector {
47+
private val logger: Logger = Logger.getLogger(this.getClass.getName)
48+
private val facetErrorsLogged = new ConcurrentHashMap[String, Long]()
49+
4550
/** Returns true if the project task should be in the result set according to the facet setting.
4651
* It collects facet values after filtering.
4752
* Values are collected for each facet, when no other facet filters out a project task. */
@@ -64,7 +69,14 @@ object ItemTypeFacetCollector {
6469
matchingFacets.add(facetSetting.facetId)
6570
}
6671
case None =>
67-
throw new IllegalArgumentException(s"Facet ID '${facetSetting.facetId}' is not available for facet collector '${this.getClass.getSimpleName}'.")
72+
// Unknown facet always matches
73+
matchingFacets.add(facetSetting.facetId)
74+
val facetKey = this.getClass.getSimpleName + "_" + facetSetting.facetId
75+
if(Option(facetErrorsLogged.get(facetKey)).isEmpty || facetErrorsLogged.get(facetKey) < (System.currentTimeMillis() - 1000)) {
76+
logger.warning(s"Wrong facet configuration in search request. Facet ID '${facetSetting.facetId}' is " +
77+
s"not available for facet collector '${this.getClass.getSimpleName}'.")
78+
facetErrorsLogged.put(facetKey, System.currentTimeMillis())
79+
}
6880
}
6981
}
7082
val allMatch = facetSettings.size == matchingFacets.size // Only when all requested facet settings match, it's an overall match

silk-workspace/src/main/scala/org/silkframework/workspace/PluginBasedWorkspaceFactory.scala

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,41 @@
1414

1515
package org.silkframework.workspace
1616

17-
import java.util.logging.{Level, Logger}
18-
19-
import javax.inject.Inject
2017
import org.silkframework.config.{Config, DefaultConfig}
2118
import org.silkframework.runtime.activity.UserContext
2219
import org.silkframework.runtime.plugin.PluginRegistry
2320
import org.silkframework.workspace.resources.ResourceRepository
2421

22+
import java.time.Instant
23+
import java.util.logging.{Level, Logger}
24+
import javax.inject.Inject
25+
2526
class PluginBasedWorkspaceFactory extends WorkspaceFactory {
2627

2728
override def workspace(implicit userContext: UserContext): Workspace = PluginBasedWorkspaceFactory.workspace
2829

2930
}
3031

3132
object PluginBasedWorkspaceFactory {
33+
3234
private val log: Logger = Logger.getLogger(this.getClass.getName.stripSuffix("$"))
35+
3336
@Inject
3437
private var configMgr: Config = DefaultConfig.instance
3538

39+
@volatile
40+
private var timestamp: Instant = Instant.MIN
41+
3642
private var _workspace: Option[Workspace] = None
3743

3844
def workspace(implicit userContext: UserContext): Workspace = this.synchronized {
3945
_workspace match {
40-
case Some(w) => w
41-
case None =>
46+
case Some(w) if !timestamp.isBefore(configMgr.timestamp) => w
47+
case _ =>
48+
if(_workspace.nonEmpty) {
49+
log.info("Reloading workspace because the configuration has been updated.")
50+
}
51+
timestamp = configMgr.timestamp
4252
try {
4353
val w = initWorkspace
4454
_workspace = Some(w)

0 commit comments

Comments
 (0)