当前位置: 首页>>代码示例>>Java>>正文


Java OWLDataFactoryImpl类代码示例

本文整理汇总了Java中uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl的典型用法代码示例。如果您正苦于以下问题:Java OWLDataFactoryImpl类的具体用法?Java OWLDataFactoryImpl怎么用?Java OWLDataFactoryImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OWLDataFactoryImpl类属于uk.ac.manchester.cs.owl.owlapi包,在下文中一共展示了OWLDataFactoryImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepare

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
@Override
void prepare() {
	final OWLDataFactory factory = new OWLDataFactoryImpl();
	A = factory.getOWLClass(IRI.create("A"));
	B = factory.getOWLClass(IRI.create("B"));
	OWLObjectProperty R = factory.getOWLObjectProperty(IRI.create("R"));
	OWLObjectProperty S = factory.getOWLObjectProperty(IRI.create("S"));
	OWLAxiom axExSsomeAsubB = factory.getOWLSubClassOfAxiom(
			factory.getOWLObjectSomeValuesFrom(S, A), B);
	OWLAxiom axReflR = factory.getOWLReflexiveObjectPropertyAxiom(R);
	axRsubS = factory.getOWLSubObjectPropertyOfAxiom(R, S);
	// from these three axioms it should follow A subclass B
	ontologyManager = TestOWLManager.createOWLOntologyManager();
	try {
		ont = ontologyManager.createOntology(new HashSet<OWLAxiom>(Arrays
				.asList(axExSsomeAsubB, axReflR, axRsubS)));
	} catch (OWLOntologyCreationException e) {
		fail(e.toString());
	}
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:21,代码来源:RoleAxiomOWLAPILowLevelIncrementalClassTest.java

示例2: getLeafClasses

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public Set<OWLClass> getLeafClasses() {
		Set<OWLClass> classes = new HashSet<OWLClass>();

		//get all OWL classes
		String query = 
				"SELECT ?leaf WHERE{" +
				" ?leaf rdfs:subClassOf ?super." +
				" FILTER NOT EXISTS { ?sup rdfs:subClassOf ?leaf }" + 
//				" FILTER regex(?leaf, \"^http://dbpedia.org/ontology\") " \\too slow
				"}";
			
		ResultSet rs = kb.executeSelect(query);
		QuerySolution qs;
		while (rs.hasNext()) {
			qs = rs.next();
			OWLDataFactory owlDataFactory = new OWLDataFactoryImpl();
			if (qs.get("leaf").isURIResource() && qs.get("leaf").toString().startsWith("http://dbpedia.org/ontology")) {
				classes.add(owlDataFactory.getOWLClass(IRI.create(qs.get("leaf").asResource().getURI())));
			}
		}
		return classes;
	}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:23,代码来源:KnowledgeBaseSampler.java

示例3: main

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public static void main(String[] args) {
        DefaultPrefixManager pm = new DefaultPrefixManager("http://test.com#");
        OWLClass A = Class(":A", pm);
        OWLClass B = Class(":B", pm);
        OWLClass C = Class(":C", pm);
        OWLObjectProperty prop = ObjectProperty(":p", pm);
        OWLIndividual i = NamedIndividual(":i", pm);
        OWLIndividual j = NamedIndividual(":j", pm);
        OWLIndividual k = NamedIndividual(":k", pm);
        OWLIndividual l = NamedIndividual(":l", pm);
        OWLDataFactory df = new OWLDataFactoryImpl();
//        OWLAxiom ax = SubClassOf(A, ObjectIntersectionOf(B, ObjectIntersectionOf(ObjectComplementOf(B), C)));
//        OWLAxiom ax = SubClassOf(A, ObjectSomeValuesFrom(prop, OWLThing()));
//        OWLAxiom ax = SubClassOf(A, ObjectAllValuesFrom(prop, B));
        OWLAxiom ax = SubClassOf(A, ObjectOneOf(i, j, k, l));
//        ToStringRenderer.getInstance().setRenderer(new DLSyntaxObjectRenderer());
        System.out.println(ax);
        System.out.println("---------------------------------------------------");
        DeltaTransformation transformation = new DeltaTransformation(df);
        for(OWLAxiom axt : transformation.transform(Collections.singleton(ax))) {
            System.out.println(axt);
        }


    }
 
开发者ID:matthewhorridge,项目名称:owlexplanation,代码行数:26,代码来源:DeltaTransformation.java

示例4: setUp

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    this.dataFactory = new OWLDataFactoryImpl();
    this.propertiesHandler = new PropertiesHandler(adapterMock,
            new OntologySnapshot(ontologyMock, managerMock, dataFactory, reasonerMock));
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:8,代码来源:PropertiesHandlerTest.java

示例5: setUp

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    this.dataFactory = new OWLDataFactoryImpl();
    final OntologySnapshot snapshot = new OntologySnapshot(ontologyMock, managerMock, dataFactory,
            reasonerMock);
    this.typesHandler = new TypesHandler(adapterMock, snapshot);
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:9,代码来源:TypesHandlerTest.java

示例6: prepare

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
@Override
void prepare() {
	final OWLDataFactory factory = new OWLDataFactoryImpl();
	A = factory.getOWLClass(IRI.create("A"));
	B = factory.getOWLClass(IRI.create("B"));
	axAsubB = factory.getOWLSubClassOfAxiom(A, B);
	axBsubA = factory.getOWLSubClassOfAxiom(B, A);
	ontologyManager = TestOWLManager.createOWLOntologyManager();
	try {
		ont = ontologyManager.createOntology(new HashSet<OWLAxiom>(Arrays
				.asList(axAsubB, axBsubA)));
	} catch (OWLOntologyCreationException e) {
		fail(e.toString());
	}
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:16,代码来源:ConceptAxiomOWLAPILowLevelIncrementalClassTest.java

示例7: createOWLOntologyManager

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public static OWLOntologyManager createOWLOntologyManager()
{
   OWLOntologyManager ontologyManager = new OWLOntologyManagerImpl(new OWLDataFactoryImpl());
   ontologyManager.addOntologyStorer(new OWLXMLOntologyStorer());
   ontologyManager.addOntologyStorer(new OWLFunctionalSyntaxOntologyStorer());
   ontologyManager.addIRIMapper(new NonMappingOntologyIRIMapper());
   ontologyManager.addOntologyFactory(new EmptyInMemOWLOntologyFactory());
   ontologyManager.addOntologyFactory(new ParsableOWLOntologyFactory());
   return ontologyManager;
}
 
开发者ID:obidea,项目名称:semantika,代码行数:11,代码来源:OntologyLoader.java

示例8: main

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public static void main(String[] args) throws IOException{
    Set<OWLClass> inputClasses = new HashSet<OWLClass>();
    OWLDataFactory owlDataFactory = new OWLDataFactoryImpl();
    inputClasses.add(owlDataFactory.getOWLClass(IRI.create("a")));
    inputClasses.add(owlDataFactory.getOWLClass(IRI.create("b")));
    inputClasses.add(owlDataFactory.getOWLClass(IRI.create("c")));
    inputClasses.add(owlDataFactory.getOWLClass(IRI.create("d")));
    LassieResultRecorder rr = new LassieResultRecorder(3, inputClasses);
    rr.saveToFile("test.txt");

}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:12,代码来源:LassieResultRecorder.java

示例9: test

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public  static void test(String sourceDatasetFile, String targetDatasetFile, String goldStandardFile, String outputFile)
            throws IOException, ComponentInitException{

        Model toyDatasetModel = readModel(sourceDatasetFile);
        Model targetKBModel   = readModel(targetDatasetFile);
        
        String oracleFile = Paths.get("src/main/resources/").toAbsolutePath().toString() + '/' + goldStandardFile;
        CSVMappingReader  mappingReader = new CSVMappingReader(oracleFile); 
        AMapping oracleMapping = mappingReader.readTwoColumnFile();
        
            long startTime = System.currentTimeMillis();
            OWLDataFactory owlDataFactory = new OWLDataFactoryImpl();
//            testClasses.add(owlDataFactory.getOWLClass(IRI.create("http://dbpedia.org/ontology/Sport")));
            LocalKnowledgeBase sourceKB = new LocalKnowledgeBase(toyDatasetModel, "http://dbpedia.org/ontology/");
            KnowledgeBase targetKB = new LocalKnowledgeBase(targetKBModel, "http://dbpedia.org/ontology/");
            LASSIEController controller = new LASSIEController(sourceKB, targetKB, maxNrOfIterations, testClasses);
            controller.setTargetDomainNameSpace("http://dbpedia.org/ontology/");
            controller.setOracleMapping(oracleMapping);
//            LassieResultRecorder experimentResults = controller.run(testClasses, false);
            LassieResultRecorder experimentResults = controller.run(false);
            logger.info("Experiment Results:\n" + experimentResults.toString());
            experimentResults.saveToFile(outputFile);

            long experimentTime = System.currentTimeMillis() - startTime;
            System.out.println("Experiment time: " + experimentTime + "ms.");
            logger.info("Experiment is done in " + experimentTime + "ms.");
    }
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:28,代码来源:TestUsingLANCEDatasets.java

示例10: main

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
/** 
 * @param args
 * @author sherif
 * @throws IOException 
 * @throws NumberFormatException 
 * @throws ComponentInitException 
 */
public static void main(String[] args) throws NumberFormatException, IOException, ComponentInitException {
	if(args.length < 9 || args[0].equals("-?")){
		logger.error("Wrong parameters number\nParameters:\n\t" +
				"args[0] = number of classes\n\t" +
				"args[1] = number of instances per class\n\t" +
				"args[2] = number of class modifiers\n\t" +
				"args[3] = number of instance modifiers\n\t" +
				"args[4] = classes destruction rate\n\t" +
				"args[5] = instances destruction rate\n\t" +
				"args[6] = number of experiment repeats\n\t" +
				"args[7] = number of iterations per experment\n\t" +
				"args[8] = output folder\n\t" +
				"OPTIONAL: args[9...n] = specific test classes, NOTE: number of test classes must equal number of classes in args[0]");
		System.exit(1);
	}
	OWLDataFactory owlDataFactory = new OWLDataFactoryImpl();
	Set<OWLClass> testClasses = new HashSet<OWLClass>();
	for(int i=9 ; i<args.length ; i++){
		testClasses.add(owlDataFactory.getOWLClass(IRI.create(args[i])));
	}
	int nrOfClasses = Integer.parseInt(args[0]);
	if(testClasses.size() > 0 && nrOfClasses > testClasses.size()){
		logger.error("Number of test class(es) is " + nrOfClasses + " while only " + testClasses.size() +" class(es) specified. EXIT LASSIE!!");
		System.exit(1);
	}
	nrOfClasses = (nrOfClasses == -1) ? Integer.MAX_VALUE : nrOfClasses;
	Experiments experiment = new Experiments();
	experiment.runExperiments(nrOfClasses, Integer.parseInt(args[1]), Integer.parseInt(args[2]), 
			Integer.parseInt(args[3]), Double.parseDouble(args[4]), Double.parseDouble(args[5]), 
			Integer.parseInt(args[6]), Integer.parseInt(args[7]), args[8], testClasses, false);
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:39,代码来源:Experiments.java

示例11: main

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public static void main(String[] args) {
    DefaultPrefixManager pm = new DefaultPrefixManager("http://test.com#");
    OWLClass clsA = Class("A", pm);
    OWLClass clsB = Class("B", pm);
    OWLClassExpression ce = ObjectIntersectionOf(clsA, ObjectIntersectionOf(clsB, clsA));
    TauGenerator tauGenerator = new TauGenerator(new OWLDataFactoryImpl());
    Set<OWLClassExpression> classExpressions = ce.accept(tauGenerator);
    for(OWLClassExpression classExpression : classExpressions) {
        System.out.println(classExpression);
    }
}
 
开发者ID:matthewhorridge,项目名称:owlexplanation,代码行数:12,代码来源:NestedIntersectionTestCase.java

示例12: ConsistencyEntailmentChecker

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public ConsistencyEntailmentChecker(OWLReasonerFactory reasonerFactory, long timeout) {
    this.timeout = timeout;
    this.reasonerFactory = reasonerFactory;
    OWLDataFactory df = new OWLDataFactoryImpl();
    this.entailment = df.getOWLSubClassOfAxiom(
            df.getOWLThing(),
            df.getOWLNothing()
    );
}
 
开发者ID:matthewhorridge,项目名称:owlexplanation,代码行数:10,代码来源:ConsistencyEntailmentChecker.java

示例13: shouldBeIndependentOfPlatformEncoding

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
@Test
public void shouldBeIndependentOfPlatformEncoding() throws IOException {
    // Need to have the default encoding set to something other than UTF-8 otherwise this test will just pass
    // even if there is a problem with the platform encoding.
    OWLObjectSerializer<OWLLiteral> literalSerializer = new OWLLiteralSerializer();
    OWLLiteral literal = new OWLLiteralImplNoCompression(TEST_STRING, "en", null);
    ByteArrayOutputStream dataOutput = new ByteArrayOutputStream();
    literalSerializer.write(literal, new BinaryOWLOutputStream(dataOutput, BinaryOWLVersion.getVersion(1)));
    OWLLiteral in = literalSerializer.read(new BinaryOWLInputStream(new ByteArrayInputStream(dataOutput.toByteArray()), new OWLDataFactoryImpl(), BinaryOWLVersion.getVersion(1)));
    assertThat(in.getLiteral(), is(equalTo(TEST_STRING)));
}
 
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:12,代码来源:EncodingTestCase.java

示例14: KnowledgeBase

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public KnowledgeBase(String ontoFile) throws OWLOntologyCreationException{
	
	
	OWLDataFactoryImpl owlDataFactoryImpl = new OWLDataFactoryImpl();
	OWLOntologyManager manager =OWLManager.createOWLOntologyManager();
	
	OWLOntology onto=manager.loadOntologyFromOntologyDocument(new File(ontoFile));
	OWLReasonerFactory f= new JFactFactory();
	reasoner = f.createNonBufferingReasoner(onto);

	//Transaction tr= session.beginTransaction();

	//	try{


	classesInSignature = onto.getClassesInSignature();
	 instances = onto.getIndividualsInSignature();
	propertyInSignature = onto.getObjectPropertiesInSignature();
}
 
开发者ID:Giuseppe-Rizzo,项目名称:owl2neo4j,代码行数:20,代码来源:KnowledgeBase.java

示例15: QueryParserImpl

import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; //导入依赖的package包/类
public QueryParserImpl() {
	df = new OWLDataFactoryImpl();
}
 
开发者ID:protegeproject,项目名称:sparql-dl-api,代码行数:4,代码来源:QueryParserImpl.java


注:本文中的uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。