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


Java PrefixMappingImpl类代码示例

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


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

示例1: testNodePrettyPrinting

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
@Test
public void testNodePrettyPrinting() {
	assertEquals("\"foo\"", 
			PrettyPrinter.toString(Node.createLiteral("foo")));
	assertEquals("\"foo\"@en", 
			PrettyPrinter.toString(Node.createLiteral("foo", "en", null)));
	assertEquals("\"1\"^^xsd:int",
			PrettyPrinter.toString(Node.createLiteral("1", null, XSDDatatype.XSDint)));
	assertEquals("\"1\"^^xsd:int",
			PrettyPrinter.toString(Node.createLiteral("1", null, XSDDatatype.XSDint), PrefixMapping.Standard));
	assertEquals("_:foo", 
			PrettyPrinter.toString(Node.createAnon(new AnonId("foo"))));
	assertEquals("<http://example.org/>", 
			PrettyPrinter.toString(Node.createURI("http://example.org/")));
	assertEquals("<" + RDF.type.getURI() + ">", 
			PrettyPrinter.toString(RDF.type.asNode(), new PrefixMappingImpl()));
	assertEquals("rdf:type", 
			PrettyPrinter.toString(RDF.type.asNode(), PrefixMapping.Standard));
	assertEquals("?x", 
			PrettyPrinter.toString(Node.createVariable("x")));
	assertEquals("?ANY",
			PrettyPrinter.toString(Node.ANY));
}
 
开发者ID:d2rq,项目名称:r2rml-kit,代码行数:24,代码来源:PrettyPrinterTest.java

示例2: testNodePrettyPrinting

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
public void testNodePrettyPrinting() {
	assertEquals("\"foo\"", 
			PrettyPrinter.toString(Node.createLiteral("foo")));
	assertEquals("\"foo\"@en", 
			PrettyPrinter.toString(Node.createLiteral("foo", "en", null)));
	assertEquals("\"1\"^^<" + XSDDatatype.XSDint.getURI() + ">",
			PrettyPrinter.toString(Node.createLiteral("1", null, XSDDatatype.XSDint)));
	assertEquals("\"1\"^^xsd:int",
			PrettyPrinter.toString(Node.createLiteral("1", null, XSDDatatype.XSDint), PrefixMapping.Standard));
	assertEquals("_:foo", 
			PrettyPrinter.toString(Node.createAnon(new AnonId("foo"))));
	assertEquals("<http://example.org/>", 
			PrettyPrinter.toString(Node.createURI("http://example.org/")));
	assertEquals("<" + RDF.type.getURI() + ">", 
			PrettyPrinter.toString(RDF.type.asNode(), new PrefixMappingImpl()));
	assertEquals("rdf:type", 
			PrettyPrinter.toString(RDF.type.asNode(), PrefixMapping.Standard));
	assertEquals("?x", 
			PrettyPrinter.toString(Node.createVariable("x")));
	assertEquals("?ANY",
			PrettyPrinter.toString(Node.ANY));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:23,代码来源:PrettyPrinterTest.java

示例3: reset

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
/**
 * <p>Reset all state in this document manager back to the default
 * values it would have had when the object was created. Optionally
 * reload the profile metadata from the search path. <strong>Note</strong>
 * that the metadata search path is not changed by this reset.</p>
 * @param reload If true, reload the configuration file from the
 * search path.
 */
public void reset( boolean reload ) {
    // first check if we are using the global file manager, or a local one
    if (m_usingGlobalFileMgr) {
        // we can do a general reset by throwing away the old FM and creating a new one
        setFileManager();
    }
    else {
        // not using the global default FM, so we reset to best effort
        getFileManager().resetCache();
    }

    m_ignoreImports.clear();
    m_prefixMap = new PrefixMappingImpl();

    setDefaults();

    if (reload) {
        initialiseMetadata( m_searchPath );
    }
}
 
开发者ID:jacekkopecky,项目名称:parkjam,代码行数:29,代码来源:OntDocumentManager.java

示例4: PrettyTurtleWriter

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
/**
 * @param baseIRI Any IRIs starting with this one will be written as relative
 */
public PrettyTurtleWriter(String baseIRI, PrefixMapping prefixes, Writer out) {
	this.baseIRI = baseIRI;
	this.out = new PrintWriter(out);
	this.prefixes = new PrefixMappingImpl();
	for (String prefix: prefixes.getNsPrefixMap().keySet()) {
		this.prefixes.setNsPrefix(prefix, relativize(prefixes.getNsPrefixURI(prefix)));
	}
	printPrefixes(this.prefixes);
	compactStack.push(false);
}
 
开发者ID:d2rq,项目名称:r2rml-kit,代码行数:14,代码来源:PrettyTurtleWriter.java

示例5: testTriplePrettyPrintingWithPrefixMapping

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
@Test
public void testTriplePrettyPrintingWithPrefixMapping() {
	PrefixMappingImpl prefixes = new PrefixMappingImpl();
	prefixes.setNsPrefixes(PrefixMapping.Standard);
	prefixes.setNsPrefix("ex", "http://example.org/");
	assertEquals("ex:a rdfs:label \"Example\".",
			PrettyPrinter.toString(new Triple(
					Node.createURI("http://example.org/a"),
					RDFS.label.asNode(),
					Node.createLiteral("Example", null, null)), prefixes));
}
 
开发者ID:d2rq,项目名称:r2rml-kit,代码行数:12,代码来源:PrettyPrinterTest.java

示例6: testTriplePrettyPrintingWithPrefixMapping

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
public void testTriplePrettyPrintingWithPrefixMapping() {
	PrefixMappingImpl prefixes = new PrefixMappingImpl();
	prefixes.setNsPrefixes(PrefixMapping.Standard);
	prefixes.setNsPrefix("ex", "http://example.org/");
	assertEquals("ex:a rdfs:label \"Example\" .",
			PrettyPrinter.toString(new Triple(
					Node.createURI("http://example.org/a"),
					RDFS.label.asNode(),
					Node.createLiteral("Example", null, null)), prefixes));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:11,代码来源:PrettyPrinterTest.java

示例7: getPrefixMapping

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
public static PrefixMapping getPrefixMapping() {
    PrefixMapping mapping = new PrefixMappingImpl();
    for (int i = 0; i < PREFIX_TO_NS_MAPPING.length; ++i) {
        mapping.setNsPrefix(PREFIX_TO_NS_MAPPING[i][0], PREFIX_TO_NS_MAPPING[i][1]);
    }
    return mapping;
}
 
开发者ID:dice-group,项目名称:Cetus,代码行数:8,代码来源:YagoBasedTypeSearcher.java

示例8: equals

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
@Override protected boolean equals( PrefixMappingImpl other )
{ return equalsByMap( other ); }
 
开发者ID:jacekkopecky,项目名称:parkjam,代码行数:3,代码来源:PolyadicPrefixMappingImpl.java

示例9: sameAs

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
@Override protected boolean sameAs( PrefixMappingImpl other )
{ return equalsByMap( other ); }
 
开发者ID:jacekkopecky,项目名称:parkjam,代码行数:3,代码来源:PolyadicPrefixMappingImpl.java

示例10: Configuration

import com.hp.hpl.jena.shared.impl.PrefixMappingImpl; //导入依赖的package包/类
public Configuration(Model configurationModel) {
	model = configurationModel;
	StmtIterator it = model.listStatements(null, RDF.type, CONF.Configuration);
	if (!it.hasNext()) {
		throw new IllegalArgumentException(
				"No conf:Configuration found in configuration model");
	}
	config = it.nextStatement().getSubject();

	datasets = new ArrayList();
	it = model.listStatements(config, CONF.dataset, (RDFNode) null);
	while (it.hasNext()) {
		datasets.add(new Dataset(it.nextStatement().getResource()));
	}
	labelProperties = new ArrayList();
	it = model.listStatements(config, CONF.labelProperty, (RDFNode) null);
	while (it.hasNext()) {
		labelProperties.add(it.nextStatement().getObject().as(Property.class));
	}
	if (labelProperties.isEmpty()) {
		labelProperties.add(RDFS.label);
		labelProperties.add(DC.title);
		labelProperties.add(model.createProperty("http://xmlns.com/foaf/0.1/name"));
	}
	commentProperties = new ArrayList();
	it = model.listStatements(config, CONF.commentProperty, (RDFNode) null);
	while (it.hasNext()) {
		commentProperties.add(it.nextStatement().getObject().as(Property.class));
	}
	if (commentProperties.isEmpty()) {
		commentProperties.add(RDFS.comment);
		commentProperties.add(DC.description);
	}
	imageProperties = new ArrayList();
	it = model.listStatements(config, CONF.imageProperty, (RDFNode) null);
	while (it.hasNext()) {
		imageProperties.add(it.nextStatement().getObject().as(Property.class));
	}
	if (imageProperties.isEmpty()) {
		imageProperties.add(model.createProperty("http://xmlns.com/foaf/0.1/depiction"));
	}
	
	prefixes = new PrefixMappingImpl();		
	if (config.hasProperty(CONF.usePrefixesFrom)) {
		it = config.listProperties(CONF.usePrefixesFrom);
		while (it.hasNext()) {
			Statement stmt = it.nextStatement();
			prefixes.setNsPrefixes(FileManager.get().loadModel(
					stmt.getResource().getURI()));
		}
	} else {
		prefixes.setNsPrefixes(model);
	}
	if (prefixes.getNsURIPrefix(CONF.NS) != null) {
		prefixes.removeNsPrefix(prefixes.getNsURIPrefix(CONF.NS));
	}
}
 
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:58,代码来源:Configuration.java


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