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


Java VCARD类代码示例

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


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

示例1: write

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Override
public void write(StringWriter writer, String format) {
    Model rdfModel = ModelFactory.createDefaultModel();
    Resource rdfRec = rdfModel.createResource(this.baseURL);
    rdfRec.addProperty(DCTerms.title, this.repositoryName)
            .addProperty(DCTerms.hasVersion, this.protocolVersion);
    for (String email : this.adminEmails){
        rdfRec.addProperty(VCARD.EMAIL, email);
    } 
    rdfModel.createTypedLiteral(this.earliestDatestamp);
    rdfModel.createTypedLiteral(this.deletedRecord);
    rdfModel.createTypedLiteral(this.granularity);
    if (!this.compressions.isEmpty()){
        for (String compression : this.compressions){
            rdfModel.createTypedLiteral(compression);
        } 
    }
    rdfModel.write(writer);
    if (this.description != null) {
        description.write(writer, format);
    }
}
 
开发者ID:DTL-FAIRData,项目名称:ODEX-FAIRDataPoint,代码行数:23,代码来源:Identify.java

示例2: resourceChangedAddBaseFileWithBase

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void resourceChangedAddBaseFileWithBase() {

	final TestBaseRegistryListener registeryListener = new TestBaseRegistryListener();
	try {
		SemanticUtils.getSemanticBaseRegistry().addListener(registeryListener);

		final Model model = ModelFactory.createDefaultModel();
		final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
		johnSmith.addProperty(VCARD.FN, "John Smith");
		final JenaBase base = new JenaBase(model, "test");
		final IProject project = createProject();
		final IFile file = createBaseFile(project, base);

		assertTrue(file != null);
		assertEquals(1, registeryListener.getBases().size());
		assertEquals("/test/test.ttl", registeryListener.getBases().get(0).getName());

		project.delete(true, new NullProgressMonitor());
	} catch (CoreException e) {
		e.printStackTrace();
		fail(e.getMessage());
	} finally {
		SemanticUtils.getSemanticBaseRegistry().removeListener(registeryListener);
	}
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:27,代码来源:SemanticBaseListenerTests.java

示例3: resourceChangedRemoveBaseFileWithBase

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void resourceChangedRemoveBaseFileWithBase() {

	final TestBaseRegistryListener registeryListener = new TestBaseRegistryListener();
	try {
		SemanticUtils.getSemanticBaseRegistry().addListener(registeryListener);

		final Model model = ModelFactory.createDefaultModel();
		final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
		johnSmith.addProperty(VCARD.FN, "John Smith");
		final JenaBase base = new JenaBase(model, "test");
		final IProject project = createProject();
		final IFile file = createBaseFile(project, base);

		assertTrue(file != null);
		assertEquals(1, registeryListener.getBases().size());
		assertEquals("/test/test.ttl", registeryListener.getBases().get(0).getName());

		project.delete(true, new NullProgressMonitor());

		assertEquals(0, registeryListener.getBases().size());
	} catch (CoreException e) {
		e.printStackTrace();
		fail(e.getMessage());
	} finally {
		SemanticUtils.getSemanticBaseRegistry().removeListener(registeryListener);
	}
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:29,代码来源:SemanticBaseListenerTests.java

示例4: resourceChangedMoveBaseFileWithBaseToNoBaseThenToBase

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void resourceChangedMoveBaseFileWithBaseToNoBaseThenToBase() {

	final TestBaseRegistryListener registeryListener = new TestBaseRegistryListener();
	try {
		SemanticUtils.getSemanticBaseRegistry().addListener(registeryListener);

		final Model model = ModelFactory.createDefaultModel();
		final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
		johnSmith.addProperty(VCARD.FN, "John Smith");
		final JenaBase base = new JenaBase(model, "test");
		final IProject project = createProject();
		IFile file = createBaseFile(project, base);

		assertTrue(file != null);
		assertEquals(1, registeryListener.getBases().size());
		assertEquals("/test/test.ttl", registeryListener.getBases().get(0).getName());

		file.move(new Path("/test/file.txt"), true, new NullProgressMonitor());
		file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/test/file.txt"));

		assertEquals(0, registeryListener.getBases().size());

		file.move(new Path("/test/file.ttl"), true, new NullProgressMonitor());

		assertEquals(1, registeryListener.getBases().size());
		assertEquals("/test/file.ttl", registeryListener.getBases().get(0).getName());

		project.delete(true, new NullProgressMonitor());
	} catch (CoreException e) {
		e.printStackTrace();
		fail(e.getMessage());
	} finally {
		SemanticUtils.getSemanticBaseRegistry().removeListener(registeryListener);
	}
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:37,代码来源:SemanticBaseListenerTests.java

示例5: resourceChangedOpenBaseFileWithBase

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void resourceChangedOpenBaseFileWithBase() {

	final TestBaseRegistryListener registeryListener = new TestBaseRegistryListener();
	try {
		SemanticUtils.getSemanticBaseRegistry().addListener(registeryListener);

		final Model model = ModelFactory.createDefaultModel();
		final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
		johnSmith.addProperty(VCARD.FN, "John Smith");
		final JenaBase base = new JenaBase(model, "test");
		final IProject project = createProject();
		final IFile file = createBaseFile(project, base);

		assertTrue(file != null);
		assertEquals(1, registeryListener.getBases().size());

		project.close(new NullProgressMonitor());

		assertEquals(0, registeryListener.getBases().size());

		project.open(new NullProgressMonitor());

		assertEquals(1, registeryListener.getBases().size());
	} catch (CoreException e) {
		e.printStackTrace();
		fail(e.getMessage());
	} finally {
		SemanticUtils.getSemanticBaseRegistry().removeListener(registeryListener);
	}
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:32,代码来源:SemanticBaseListenerTests.java

示例6: resourceChangedCloseBaseFileWithBase

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void resourceChangedCloseBaseFileWithBase() {

	final TestBaseRegistryListener registeryListener = new TestBaseRegistryListener();
	try {
		SemanticUtils.getSemanticBaseRegistry().addListener(registeryListener);

		final Model model = ModelFactory.createDefaultModel();
		final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
		johnSmith.addProperty(VCARD.FN, "John Smith");
		final JenaBase base = new JenaBase(model, "test");
		final IProject project = createProject();
		final IFile file = createBaseFile(project, base);

		assertTrue(file != null);
		assertEquals(1, registeryListener.getBases().size());

		project.close(new NullProgressMonitor());

		assertEquals(0, registeryListener.getBases().size());
	} catch (CoreException e) {
		e.printStackTrace();
		fail(e.getMessage());
	} finally {
		SemanticUtils.getSemanticBaseRegistry().removeListener(registeryListener);
	}
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:28,代码来源:SemanticBaseListenerTests.java

示例7: getName

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void getName() {
	final Model model = ModelFactory.createDefaultModel();
	final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
	johnSmith.addProperty(VCARD.FN, "John Smith");
	final JenaBase base = new JenaBase(model, "test");

	assertEquals("test", base.getName());
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:10,代码来源:JenaBaseTests.java

示例8: getConcepts

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void getConcepts() {
	final Model model = ModelFactory.createDefaultModel();
	final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
	johnSmith.addProperty(VCARD.FN, "John Smith");
	final JenaBase base = new JenaBase(model, "test");

	assertEquals(1, base.getConcepts().size());
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:10,代码来源:JenaBaseTests.java

示例9: getModel

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
@Test
public void getModel() {
	final Model model = ModelFactory.createDefaultModel();
	final Resource johnSmith = model.createResource("http://somewhere/JohnSmith");
	johnSmith.addProperty(VCARD.FN, "John Smith");
	final JenaBase base = new JenaBase(model, "test");

	assertEquals(model, base.getModel());
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:10,代码来源:JenaBaseTests.java

示例10: createIndividual

import org.apache.jena.vocabulary.VCARD; //导入依赖的package包/类
private Model createIndividual(VirtualEntity virtualEntity) {
        // some definitions
        String personURI = "http://somewhere/JohnSmith";
        String givenName = "John";
        String familyName = "Smith";
        String fullName = givenName + " " + familyName;

// create an empty Model
        Model model = ModelFactory.createDefaultModel();

// create the resource
//   and add the properties cascading style
        Resource johnSmith
                = model.createResource(personURI)
                        .addProperty(VCARD.FN, fullName)
                        .addProperty(VCARD.N,
                                model.createResource()
                                        .addProperty(VCARD.Given, givenName)
                                        .addProperty(VCARD.Family, familyName));

        // list the statements in the Model
        StmtIterator iter = model.listStatements();

// print out the predicate, subject and object of each statement
        while (iter.hasNext()) {
            Statement stmt = iter.nextStatement();  // get next statement
            Resource subject = stmt.getSubject();     // get the subject
            Property predicate = stmt.getPredicate();   // get the predicate
            RDFNode object = stmt.getObject();      // get the object

            System.out.print(subject.toString());
            System.out.print(" " + predicate.toString() + " ");
            if (object instanceof Resource) {
                System.out.print(object.toString());
            } else {
                // object is a literal
                System.out.print(" \"" + object.toString() + "\"");
            }

            System.out.println(" .");
        }

        return model;
    }
 
开发者ID:nailtonvieira,项目名称:cloudsemanticwot,代码行数:45,代码来源:DataConnectorImpl.java


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