@import controllers.rules.routes.Assets @import models.linking.EvalLink._ @import models.linking._ @import org.silkframework.entity.Entity @import org.silkframework.entity.paths.UntypedPath @import org.silkframework.rule.LinkSpec @import org.silkframework.rule.evaluation._ @import org.silkframework.rule.execution.LinkingStatistics @import org.silkframework.runtime.activity.UserContext @import org.silkframework.util.DPair @import org.silkframework.workspace.{Project, ProjectTask} @import java.util.UUID @import org.silkframework.workbench.Context @(project: Project, task: ProjectTask[LinkSpec], links: Seq[EvalLink], linkingStatistics: Option[LinkingStatistics], linkResolvers: DPair[LinkResolver], sorting: LinkSorter, filter: String, page: Int, showStatus: Boolean, showDetails: Boolean, showEntities: Boolean, rateButtons: Boolean)(implicit userContext: UserContext) @render(getPageLinks()) @for(statistics <- linkingStatistics) { @linkingReport(statistics, links.size) } @getPageLinks() = @{ val pageSize = 100 val filteredLinks = LinkFilter(links, filter.stripPrefix("filter:")) val sortedLinks = sorting(filteredLinks) val pageLinks = sortedLinks.view(page * pageSize, (page + 1) * pageSize).toSeq pageLinks } @render(pageLinks: Seq[EvalLink]) = {

@for((link, index) <- pageLinks.zipWithIndex) { @renderLink(link, index) }

} @sortableHeader(ascendingSorter: LinkSorter, descendingSorter: LinkSorter)(content: Html) = { @content {@Assets.at("img/sort-descending.png")} case _ => {@Assets.at("img/sort.png")} }"/> } @renderLink(link: EvalLink, counter: Int) = { } @renderStatus(linkType: EvalLink.LinkType, correct: EvalLink.Correctness) = { @linkType match { case Positive if correct == Correct => {
correct
} case Positive if correct == Incorrect => {
incorrect
} case Negative if correct == Correct => {
correct
} case Negative if correct == Incorrect => {
incorrect
} case Generated if correct == Correct => {
correct
} case Generated if correct == Incorrect => {
wrong
} case _ => {
unknown
} } } @renderButtons(link: EvalLink) = { @widgets.linkButtons(link, rateButtons) } @renderEntities(entities: DPair[Entity]) = { } @renderEntity(entity: Entity, divClassPrefix: String) = {
  • @project.config.prefixes.shorten(entity.uri)
  • } @renderValues(path: UntypedPath, values: Seq[String], divClassPrefix: String) = {
  • @path.serialize()(project.config.prefixes) @values.take(10).map(v => {project.config.prefixes.shorten(v)}) @if(values.size > 10) {...} else {}
  • } @renderDetails(details: Option[Confidence]) = { @details match { case Some(similarity) => { } case None => {No details} }} @renderSimilarity(similarity: Confidence) = { @similarity match { case AggregatorConfidence(value, aggregation, children) => {
  • Aggregation:@aggregation.aggregator.pluginSpec.id (@aggregation.id) @renderConfidence(value)
  • } case ComparisonConfidence(value, comparison, input1, input2) => {
  • Comparison:@comparison.metric.pluginSpec.id (@comparison.id) @renderConfidence(value)
  • } case SimpleConfidence(value) => {
  • Link Specification is empty
  • } }} @renderValue(value: Value, divClassPrefix: String) = { @value match { case TransformedValue(transform, values, children, error) => {
  • Transform: @transform.transformer.pluginSpec.id (@transform.id) @values.map(v => {v}) @renderError(value.formattedErrorMessage)
  • } case InputValue(input, values, error) => {
  • Input: @input.path.serialize()(project.config.prefixes) (@input.id) @for(v <- values) { @convertToLinkIfDetected(v) } @renderError(value.formattedErrorMessage)
  • } }} @convertToLinkIfDetected(valueString: String) = { @if(valueString.startsWith("http://") || valueString.startsWith("https://")) { @valueString } else { @valueString } } @generateEntityLink(entityUri: String, linkResolver: LinkResolver) = { @linkResolver(entityUri) match { case Some(link) => { @project.config.prefixes.shorten(entityUri) } case None => { @project.config.prefixes.shorten(entityUri) } } } @renderConfidence(value: Option[Double]) = { @value match { case Some(v) => {
    @{"%.1f".format((v) * 100)}%
    } case None => {} }} @renderError(error: Option[String], id: String = UUID.randomUUID.toString) = { @for(e <- error) { } } @id(link: EvalLink, prefix: String = "") = @{ prefix + link.hashCode }