Skip to content

Commit

Permalink
Added title of alpha sections
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Mar 4, 2022
1 parent 269ef32 commit 4c402ef
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import fr.sparna.rdf.rdf4j.toolkit.query.Perform;
import fr.sparna.rdf.rdf4j.toolkit.repository.RepositoryBuilderFactory;
import fr.sparna.rdf.rdf4j.toolkit.repository.init.ApplyUpdates;
import fr.sparna.rdf.rdf4j.toolkit.util.LabelReader;
import fr.sparna.rdf.rdf4j.toolkit.util.Namespaces;
import fr.sparna.rdf.skos.printer.DisplayPrinter;
import fr.sparna.rdf.skos.printer.DisplayPrinter.Style;
Expand Down Expand Up @@ -146,6 +147,7 @@ public int compare(QueryResultRow o1, QueryResultRow o2) {

});


boolean addSections = queryResultRows.size() > 200;
log.debug("Processing "+queryResultRows.size()+" entries.");
Namespaces namespaces = Namespaces.getInstance().withRepository(this.connection.getRepository());
Expand Down Expand Up @@ -174,13 +176,20 @@ public int compare(QueryResultRow o1, QueryResultRow o2) {
d.getSection().add(currentSection);
} else {
log.debug("Single section added to output");

Section s = new Section();
fr.sparna.rdf.skos.printer.schema.List list = new fr.sparna.rdf.skos.printer.schema.List();
s.setList(list);
for (QueryResultRow aRow : queryResultRows) {
ConceptBlock cb = buildConceptBlock(connection, aRow, namespaces);
list.getListItem().add(SchemaFactory.createListItem(cb));
}

// read label of concept scheme to use as title
LabelReader labelReader = new LabelReader(this.connection, lang);
String title = LabelReader.display(labelReader.getValues(conceptScheme));
s.setTitle(title+" : A-Z");

d.getSection().add(s);
}

Expand Down

0 comments on commit 4c402ef

Please sign in to comment.