All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.qudtlib.tools.contributions.archive.ContributeFixedPrefixes Maven / Gradle / Ivy

There is a newer version: 6.8.0
Show newest version
package io.github.qudtlib.tools.contributions.archive;

import io.github.qudtlib.Qudt;
import io.github.qudtlib.tools.contribute.QudtEntityGenerator;

public class ContributeFixedPrefixes {
    public static void main(String[] args) {
        QudtEntityGenerator entityGenerator = new QudtEntityGenerator();
        entityGenerator.unitOfWork(
                tool -> {
                    Qudt.allUnits().stream()
                            .filter(u -> u.getPrefix().isPresent())
                            .filter(
                                    u ->
                                            u.getIriLocalname()
                                                            .toLowerCase()
                                                            .indexOf(
                                                                    u
                                                                            .getPrefix()
                                                                            .get()
                                                                            .getLabels()
                                                                            .stream()
                                                                            .findFirst()
                                                                            .get()
                                                                            .getString()
                                                                            .toLowerCase())
                                                    == -1)
                            .forEach(
                                    u -> {
                                        System.err.println(
                                                String.format(
                                                        "check unit %s: prefix label %s not found in localname",
                                                        u.getIriAbbreviated(),
                                                        u.getPrefix().get().getLabels().stream()
                                                                .findFirst()
                                                                .get()));
                                    });
                });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy