Examples of QNameShortFormProvider


Examples of org.semanticweb.owlapi.util.QNameShortFormProvider

public class ShortFormProviderTestCase {

    @Test
    public void shouldFindShortForm() {
        OWLClass c = Class(IRI("http://www.ebi.ac.uk/fgpt/ontologies/test/TEST_00001> test:TEST_00001"));
        QNameShortFormProvider shortener = new QNameShortFormProvider();
        String shortform = shortener.getShortForm(c);
        assertEquals("test:TEST_00001", shortform);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.QNameShortFormProvider

    }

    @Test
    public void shouldFindShortFormForWoman() {
        OWLClass c = Class(IRI("http://www.example.org/#Woman"));
        QNameShortFormProvider shortener = new QNameShortFormProvider();
        String shortform = shortener.getShortForm(c);
        assertEquals("www:Woman", shortform);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.QNameShortFormProvider

    @Test
    public void shouldFindShortFormForSetPRefix() {
        OWLClass c = Class(IRI("http://www.example.org/#Woman"));
        Map<String, String> prefixes = new HashMap<>();
        prefixes.put("test", "http://www.example.org/#");
        QNameShortFormProvider shortener = new QNameShortFormProvider(prefixes);
        String shortform = shortener.getShortForm(c);
        assertEquals("test:Woman", shortform);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.QNameShortFormProvider

        return shortForms.getShortForm(entity);
    }

    public OWLTutorialSyntaxObjectRenderer(Writer writer) {
        this.writer = writer;
        shortForms = new QNameShortFormProvider();
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.QNameShortFormProvider

    }

    public synchronized String getShortForm(OWLEntity owlEntity) {
        try {
            if(owlEntity.isBuiltIn() || startsWithBuiltInPrefix(owlEntity)) {
                QNameShortFormProvider qNameShortFormProvider = new QNameShortFormProvider(builtinPrefixes);
                return qNameShortFormProvider.getShortForm(owlEntity);
            }
            int matchedIndex = Integer.MAX_VALUE;
//        int matchedLangIndex = Integer.MAX_VALUE;
            boolean matchedDefaultLang = false;
            OWLAnnotationValue renderingValue = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.