• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XSD类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getLabelFromBuiltIn

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
private String getLabelFromBuiltIn(String uri){
	try {
		IRI iri = IRI.create(URLDecoder.decode(uri, "UTF-8"));
		
		// if IRI is built-in entity
		if(iri.isReservedVocabulary()) {
			// use the short form
			String label = sfp.getShortForm(iri);
			
			 // if it is a XSD numeric data type, we attach "value"
            if(uri.equals(XSD.nonNegativeInteger.getURI()) || uri.equals(XSD.integer.getURI())
            		|| uri.equals(XSD.negativeInteger.getURI()) || uri.equals(XSD.decimal.getURI())
            		|| uri.equals(XSD.xdouble.getURI()) || uri.equals(XSD.xfloat.getURI())
            		|| uri.equals(XSD.xint.getURI()) || uri.equals(XSD.xshort.getURI())
            		|| uri.equals(XSD.xbyte.getURI()) || uri.equals(XSD.xlong.getURI())
            		){
            	label += " value";
            }
            
            return label;
		}
	} catch (UnsupportedEncodingException e) {
		logger.error("Getting short form of " + uri + "failed.", e);
	}
	return null;
}
 
开发者ID:dice-group,项目名称:RDF2PT,代码行数:27,代码来源:DefaultIRIConverter.java


示例2: getLabelFromBuiltIn

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
private String getLabelFromBuiltIn(String uri) {
	try {
		IRI iri = IRI.create(URLDecoder.decode(uri, "UTF-8"));

		// if IRI is built-in entity
		if (iri.isReservedVocabulary()) {
			// use the short form
			String label = sfp.getShortForm(iri);

			// if it is a XSD numeric data type, we attach "value"
			if (uri.equals(XSD.nonNegativeInteger.getURI()) || uri.equals(XSD.integer.getURI())
					|| uri.equals(XSD.negativeInteger.getURI()) || uri.equals(XSD.decimal.getURI())
					|| uri.equals(XSD.xdouble.getURI()) || uri.equals(XSD.xfloat.getURI())
					|| uri.equals(XSD.xint.getURI()) || uri.equals(XSD.xshort.getURI())
					|| uri.equals(XSD.xbyte.getURI()) || uri.equals(XSD.xlong.getURI())) {
				label += " value";
			}

			return label;
		}
	} catch (UnsupportedEncodingException e) {
		logger.error("Getting short form of " + uri + "failed.", e);
	}
	return null;
}
 
开发者ID:dice-group,项目名称:RDF2PT,代码行数:26,代码来源:DefaultIRIConverterFrench.java


示例3: parseXsdType

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/**
 * Returns the {@link Datatype} instance fitting the given XSD datatype or
 * {@link Datatype#STRING} if no valid type can be found.
 *
 *
 * @param typeResource
 *            XSD resource
 * @return the datatype for this resource
 */
public static Datatype parseXsdType(Resource typeResource) {
    if (XSD.xstring.equals(typeResource)) {
        return Datatype.STRING;
    } else if (XSD.xboolean.equals(typeResource)) {
        return Datatype.BOOLEAN;
    } else if (XSD.decimal.equals(typeResource)) {
        return Datatype.DECIMAL;
    } else if (XSD.xint.equals(typeResource)) {
        return Datatype.INTEGER;
    } else if (XSD.unsignedInt.equals(typeResource) || XSD.positiveInteger.equals(typeResource)) {
        return Datatype.UNSIGNED_INT;
    } else if (XSD.xdouble.equals(typeResource)) {
        return Datatype.DOUBLE;
    } else if (XSD.xfloat.equals(typeResource)) {
        return Datatype.FLOAT;
    } else {
        LOGGER.warn("Got an unsupported parameter type: {}. It will be handled as String.", typeResource.getURI());
        return Datatype.STRING;
    }
}
 
开发者ID:hobbit-project,项目名称:platform,代码行数:30,代码来源:RdfModelHelper.java


示例4: createTyped

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
public static final RDFNode createTyped(String value, Resource valueType)
   {
if (value == null) throw new IllegalArgumentException("Param value cannot be null");

       // without value type, return default xsd:string value
       if (valueType == null) return ResourceFactory.createTypedLiteral(value, XSDDatatype.XSDstring);

       // if value type is from XSD namespace, value is treated as typed literal with XSD datatype
       if (valueType.getNameSpace().equals(XSD.getURI()))
       {
           RDFDatatype dataType = NodeFactory.getType(valueType.getURI());
           return ResourceFactory.createTypedLiteral(value, dataType);
       }
       // otherwise, value is treated as URI resource
       else
           return ResourceFactory.createResource(value);
   }
 
开发者ID:AtomGraph,项目名称:Processor,代码行数:18,代码来源:RDFNodeFactory.java


示例5: test_OwlProfile

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
@Test
public void test_OwlProfile() {
	OwlProfile owlProfile = new OwlProfile(OwlProfileEnum.OWL1_Lite);
	
	assertFalse(owlProfile.isOwl2());		
	assertFalse(owlProfile.supportsStatement(OWL.complementOf, null));
	assertFalse(owlProfile.supportsStatement(OWL2.hasKey, null));
	assertFalse(owlProfile.supportsStatement(OWL.oneOf, null));
	assertFalse(owlProfile.supportsStatement(OWL.unionOf, null));		
	
	assertFalse(owlProfile.supportsStatement(OWL.disjointWith, uri1));
	assertFalse(owlProfile.supportsStatement(OWL.disjointWith, uriList));
	
	assertTrue(owlProfile.supportsStatement(RDF.type, null));
	
	assertTrue(owlProfile.supportDataType(XSD.xstring));
	assertTrue(owlProfile.supportDataType(XSD.integer));
	assertTrue(owlProfile.supportDataType(XSD.decimal));
	assertTrue(owlProfile.supportDataType(XSD.dateTime));
	assertTrue(owlProfile.supportDataType(XSD.xdouble));
	assertTrue(owlProfile.supportDataType(XSD.xboolean));
	
	assertFalse(owlProfile.supportDataType(RdfVocabulary.OWL.real));	
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:25,代码来源:Test_OwlProfile_supportsStatement.java


示例6: test_SupportStatement_Owl1DL

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
@Test
public void test_SupportStatement_Owl1DL() {
	OwlProfile owlProfile = new OwlProfile(OwlProfileEnum.OWL1_DL);

	assertFalse(owlProfile.isOwl2());		
	assertTrue(owlProfile.supportsStatement(OWL.complementOf, null));
	assertTrue(owlProfile.supportsStatement(OWL2.hasKey, null));
	assertTrue(owlProfile.supportsStatement(OWL.oneOf, null));
	assertTrue(owlProfile.supportsStatement(OWL.unionOf, null));		
	
	assertTrue(owlProfile.supportsStatement(OWL.disjointWith, uri1));
	assertFalse(owlProfile.supportsStatement(OWL.disjointWith, uriList));
	
	assertTrue(owlProfile.supportsStatement(RDF.type, null));
	
	assertTrue(owlProfile.supportDataType(XSD.xstring));
	assertTrue(owlProfile.supportDataType(XSD.integer));
	assertTrue(owlProfile.supportDataType(XSD.decimal));
	assertTrue(owlProfile.supportDataType(XSD.dateTime));
	assertTrue(owlProfile.supportDataType(XSD.xdouble));
	assertTrue(owlProfile.supportDataType(XSD.xboolean));
	
	assertFalse(owlProfile.supportDataType(RdfVocabulary.OWL.real));		
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:25,代码来源:Test_OwlProfile_supportsStatement.java


示例7: test_SupportStatement_Owl1Full

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
@Test
public void test_SupportStatement_Owl1Full() {
	OwlProfile owlProfile = new OwlProfile(OwlProfileEnum.OWL1_Full);
	
	assertFalse(owlProfile.isOwl2());
	assertTrue(owlProfile.supportsStatement(OWL.complementOf, null));
	assertTrue(owlProfile.supportsStatement(OWL2.hasKey, null));
	assertTrue(owlProfile.supportsStatement(OWL.oneOf, null));
	assertTrue(owlProfile.supportsStatement(OWL.unionOf, null));		
	assertTrue(owlProfile.supportsStatement(RDF.type, null));		
	
	assertTrue(owlProfile.supportsStatement(OWL.disjointWith, uri1));
	assertFalse(owlProfile.supportsStatement(OWL.disjointWith, uriList));
	
	assertTrue(owlProfile.supportDataType(XSD.xstring));
	assertTrue(owlProfile.supportDataType(XSD.integer));
	assertTrue(owlProfile.supportDataType(XSD.decimal));
	assertTrue(owlProfile.supportDataType(XSD.dateTime));
	assertTrue(owlProfile.supportDataType(XSD.xdouble));
	assertTrue(owlProfile.supportDataType(XSD.xboolean));
	
	assertFalse(owlProfile.supportDataType(RdfVocabulary.OWL.real));
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:24,代码来源:Test_OwlProfile_supportsStatement.java


示例8: test_SupportStatement_Owl2DL

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
@Test
public void test_SupportStatement_Owl2DL() {
	OwlProfile owlProfile = new OwlProfile(OwlProfileEnum.OWL2_DL);

	assertTrue(owlProfile.isOwl2());

	assertTrue(owlProfile.supportsStatement(OWL.complementOf, null));
	assertTrue(owlProfile.supportsStatement(OWL2.hasKey, null));
	assertTrue(owlProfile.supportsStatement(OWL.oneOf, null));
	assertTrue(owlProfile.supportsStatement(OWL.unionOf, null));		
	assertTrue(owlProfile.supportsStatement(RDF.type, null));		
	
	assertTrue(owlProfile.supportsStatement(OWL.disjointWith, uri1));
	assertTrue(owlProfile.supportsStatement(OWL.disjointWith, uriList));
	
	assertTrue(owlProfile.supportDataType(XSD.xstring));
	assertTrue(owlProfile.supportDataType(XSD.integer));
	assertTrue(owlProfile.supportDataType(XSD.decimal));
	assertTrue(owlProfile.supportDataType(XSD.dateTime));

	assertTrue(owlProfile.supportDataType(XSD.xdouble));
	assertTrue(owlProfile.supportDataType(XSD.xboolean));
	assertTrue(owlProfile.supportDataType(RdfVocabulary.OWL.real));
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:25,代码来源:Test_OwlProfile_supportsStatement.java


示例9: getBaseTypeForBooleans

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/**
 * Returns the equivalent XSD datatype for IFC types: BOOLEAN and LOGICAL
 * @return
 */
public Resource getBaseTypeForBooleans() {
	
	if (baseTypeForBooleans == null) {
		String convertBooleanValuesTo = context.getConversionParams().convertBooleansTo();
		switch (convertBooleanValuesTo) {
		case StringParam.VALUE_AUTO:
		case Ifc2RdfConversionParams.VALUE_NAMED_INDIVIDUAL:
			baseTypeForBooleans = OWL2.NamedIndividual;
			break;
		case Ifc2RdfConversionParams.VALUE_XSD_STRING:
			baseTypeForBooleans = XSD.xstring;
			break;
		case Ifc2RdfConversionParams.VALUE_XSD_BOOLEAN:
			baseTypeForBooleans = XSD.xboolean;
			break;
		default:
			throw new IllegalArgumentException("Invalid value of option " + Ifc2RdfConversionParams.PARAM_CONVERT_BOOLEANS_TO);
		}
	}
	return baseTypeForBooleans;		
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:26,代码来源:Ifc2RdfExporterBase.java


示例10: getBaseTypeForEnums

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/**
 * Returns the equivalent XSD datatype for IFC types: ENUM and LOGICAL
 * @return
 */
private Resource getBaseTypeForEnums() {
	
	if (baseTypeForEnums == null) {
		String convertEnumValuesTo = (String)context.getConversionParams().getParamValue(Ifc2RdfConversionParams.PARAM_CONVERT_ENUMS_TO);
		switch (convertEnumValuesTo) {
		case StringParam.VALUE_AUTO:
		case Ifc2RdfConversionParams.VALUE_NAMED_INDIVIDUAL:
			baseTypeForEnums = OWL2.NamedIndividual;
			break;
		case Ifc2RdfConversionParams.VALUE_XSD_STRING:
			baseTypeForEnums = XSD.xstring;
			break;
		default:
			throw new IllegalArgumentException("Invalid value of option " + Ifc2RdfConversionParams.PARAM_CONVERT_ENUMS_TO);
		}
	}
	return baseTypeForEnums;
	
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:24,代码来源:Ifc2RdfExporterBase.java


示例11: setNsPrefixes

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
public static void setNsPrefixes(Model jenaModel, Ifc2RdfConverter converter) {
	// define owl:
	jenaModel.setNsPrefix(RdfVocabulary.OWL.BASE_PREFIX, OWL.getURI());

	// define rdf:
	jenaModel.setNsPrefix(RdfVocabulary.RDF.BASE_PREFIX, RDF.getURI());

	// define rdfs:
	jenaModel.setNsPrefix(RdfVocabulary.RDFS.BASE_PREFIX, RDFS.getURI());

	// define xsd:
	jenaModel.setNsPrefix(RdfVocabulary.XSD.BASE_PREFIX, XSD.getURI());

	// define expr:
	jenaModel.setNsPrefix(Ifc2RdfVocabulary.EXPRESS.BASE_PREFIX,
			Ifc2RdfVocabulary.EXPRESS.getBaseUri());

	// define ifc:
	if (converter != null) {
		jenaModel.setNsPrefix(Ifc2RdfVocabulary.IFC.BASE_PREFIX,
				converter.getIfcOntologyNamespaceUri());
	}
}
 
开发者ID:Web-of-Building-Data,项目名称:drumbeat-ifc2ld,代码行数:24,代码来源:DrumbeatTestHelper.java


示例12: toXMLText

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
public boolean toXMLText(Element element, RDFNode rdf, String type, String pack, Context ctx) {
	String v;
	Document doc = element.getOwnerDocument();
	
	simpleType s = ctx.getSimpleType(type);
	if (s!=null) return s.toXML(element,rdf,pack,ctx);

	if (type!=null && type.equals(XSD_URI+"#IDREFS") && rdf instanceof Resource
			&& ((Resource)rdf).hasProperty(RDF.first)
			&& rdf.canAs(RDFList.class)) {
		RDFList l = (RDFList) rdf.as(RDFList.class);
		for (ExtendedIterator i=l.iterator(); i.hasNext();) {
			v = toXMLValue(element, (RDFNode) i.next(), XSD.IDREF.getURI(), ctx);
			if (v==null) return false; // failed for this type
			element.appendChild(doc.createTextNode(pack==null?v:pack+v));
			pack = " ";
		}
		return true;
	}
	String val = toXMLValue(element, rdf, type, ctx);
	if (val!=null) {
		element.appendChild(doc.createTextNode(pack==null?val:pack+val));
		return true;
	}
	return false;
}
 
开发者ID:stevebattle,项目名称:Gloze,代码行数:27,代码来源:schema.java


示例13: toXML

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
private void toXML(Element e, Context ctx, attribute def, String type, RDFNode object) 
throws Exception {
	Document doc = e.getOwnerDocument();
	schema xs = (schema) this.get_owner();
	Attr a;
	if (isQualified()) {
		String ns = xs.getTargetNamespace();
		a = doc.createAttributeNS(ns, def.getName());
		//if (Character.isLetterOrDigit(ns.charAt(ns.length()-1))) ns += "#";
		a.setPrefix(ctx.getModel().getNsURIPrefix(ns));
		e.setAttributeNodeNS(a);
	}
	else e.setAttributeNode(a = doc.createAttribute(def.getName()));

	XMLBean t = get_type(ctx);
	if (t instanceof simpleType) ((simpleType) t).toXML(a,object,ctx);
	else if (type != null && type.endsWith("IDREFS"))
		xs.listToXML(a,(RDFList) object.as(RDFList.class),XSD.IDREF.getURI(),ctx);
	else a.setValue(xs.toXMLValue(e,object,type,ctx));
}
 
开发者ID:stevebattle,项目名称:Gloze,代码行数:21,代码来源:attribute.java


示例14: getTimeUnits

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
static private List<TimeUnit> getTimeUnits(Cube cube)
{
	List<TimeUnit> timeUnits = cubeToTimeUnits.get(cube);
	if(timeUnits==null)
	{
		synchronized(cube)
		{
			if(timeUnits==null) {
				timeUnits = Arrays.asList(
						new TimeUnit(cube,"day",XSD.gDay),
						new TimeUnit(cube,"day",XSD.date),
						new TimeUnit(cube,"month",XSD.gMonth),
						new TimeUnit(cube,"year",XSD.gYear)
						).stream().filter(tu->tu.property.isPresent()).collect(Collectors.toList());
				cubeToTimeUnits.put(cube, timeUnits);
			}
		}
	}
	return timeUnits;
}
 
开发者ID:AskNowQA,项目名称:cubeqa,代码行数:21,代码来源:PerTimeDetector.java


示例15: match

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/** How probably is the phrase referring to this property? */
public double match(final String phrase)
{
	String noStop = Stopwords.remove(phrase, Stopwords.PROPERTY_WORDS).toLowerCase();
	OptionalDouble pLabelOpt = labels.stream().mapToDouble(l->Similarity.similarity(Stopwords.remove(l,Stopwords.PROPERTY_WORDS).toLowerCase(),noStop)).max();
	double pLabel = pLabelOpt.isPresent()?pLabelOpt.getAsDouble():0;
	log.trace("p label for "+noStop+": "+pLabel);
	if(phrase.contains("agencies"))
	{
		System.out.println(phrase+": "+this.labels+" "+pLabel);
	}

	OptionalDouble pRangeOpt = MATCH_RANGE? rangeLabels.stream().mapToDouble(l->Similarity.similarity(l,noStop)).max():OptionalDouble.of(0);
	// we only want objectproperties, so exclude xsd
	double pRange = (pRangeOpt.isPresent()&&!range.startsWith(XSD.getURI()))?pRangeOpt.getAsDouble()*RANGE_LABEL_MULTIPLIER:0;
	log.trace("p range for "+noStop+": "+pRange);
	return Math.max(pLabel, pRange);
}
 
开发者ID:AskNowQA,项目名称:cubeqa,代码行数:19,代码来源:ComponentProperty.java


示例16: getJDateTime

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
protected DateTime getJDateTime() {
    XSDDateTime xdt = getXSDDateTime();
    if (getDatatype().equals(XSD.dateTime.getURI())) {
        int ms = (int)Math.round( 1000.0 * (xdt.getSeconds() - xdt.getFullSeconds()) );
        DateTime jdt =  
                new DateTime(xdt.getYears(), xdt.getMonths(), xdt.getDays(), xdt.getHours(), xdt.getMinutes(), xdt.getFullSeconds(), ms, DateTimeZone.UTC);
        return jdt;
    } else if (getDatatype().equals(XSD.date.getURI())) {
        return new DateTime(xdt.getYears(), xdt.getMonths(), xdt.getDays(), 0, 0);
    } else if (getDatatype().equals(XSD.gYearMonth.getURI())) {
        return new DateTime(xdt.getYears(), xdt.getMonths(), 0, 0, 0);
    } else if (getDatatype().equals(XSD.gYear.getURI())) {
        return new DateTime(xdt.getYears(), 1, 0, 0, 0);
    } else {
        throw new EpiException("Unsupport date time format: " + getDatatype());
    }
}
 
开发者ID:epimorphics,项目名称:dclib,代码行数:18,代码来源:ValueDate.java


示例17: testCoercions

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
@Test
public void testCoercions() {
    doTestCoercion("2014", XSD.gYear.getURI(), "2014");
    
    try {
        doTestCoercion("2014 03", XSD.gYearMonth.getURI(), "2014-03");
        assertTrue("Should have raised exception", false);
    } catch (Exception e) { }
    doTestCoercion("2014 03", "yyyy MM", XSD.gYearMonth.getURI(), "2014-03");
    doTestCoercion("2014 03", "yyyy-MM|yyyy MM", XSD.gYearMonth.getURI(), "2014-03");
    
    doTestCoercion("2014 02 03", "yyyy dd MM", XSD.date.getURI(), "2014-03-02");
    doTestCoercion("2014 02 03 -05:00", "yyyy dd MM Z", XSD.date.getURI(), "2014-03-02-05:00");
    
    doTestCoercion("12 59 03", "HH mm ss", XSD.time.getURI(), "12:59:03");
    doTestCoercion("12 59", "HH mm", XSD.time.getURI(), "12:59:00");
    doTestCoercion("12 59 03 +0600", "HH mm ss Z", XSD.time.getURI(), "12:59:03+06:00");
    
    doTestCoercion("02 03 2014 15-34-03", "dd MM yyyy HH-mm-ss", XSD.dateTime.getURI(), "2014-03-02T15:34:03");
    doTestCoercion("02 03 2014 15-34-03 +0100", "dd MM yyyy HH-mm-ss Z", XSD.dateTime.getURI(), "2014-03-02T15:34:03+01:00");
    doTestCoercion("02 03 2014 15-34-03 Z", "dd MM yyyy HH-mm-ss Z", XSD.dateTime.getURI(), "2014-03-02T15:34:03Z");
}
 
开发者ID:epimorphics,项目名称:dclib,代码行数:23,代码来源:TestValueDate.java


示例18: filter

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/**
 * Filter triples which are not relevant based on the given knowledge base
 * namespace.
 *
 * @param model
 * @param namespace
 */
private void filter(Model model, String namespace) {
    List<Statement> statementsToRemove = new ArrayList<Statement>();
    for (Iterator<Statement> iter = model.listStatements().toList().iterator(); iter.hasNext();) {
        Statement st = iter.next();
        Property predicate = st.getPredicate();
        if (predicate.equals(RDF.type)) {
            if (!st.getObject().asResource().getURI().startsWith(namespace)) {
                statementsToRemove.add(st);
            } else if (st.getObject().equals(OWL.FunctionalProperty.asNode())) {
                statementsToRemove.add(st);
            } else if (st.getObject().isLiteral() && st.getObject().asLiteral().getDatatypeURI().equals(XSD.gYear.getURI())) {
                statementsToRemove.add(st);
            }
        } else if (!predicate.equals(RDFS.subClassOf) && !predicate.equals(OWL.sameAs) && !predicate.asResource().getURI().startsWith(namespace)) {
            statementsToRemove.add(st);
        }
    }
    model.remove(statementsToRemove);
}
 
开发者ID:dice-group,项目名称:LASSIE,代码行数:27,代码来源:LASSIEController.java


示例19: initGraph

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/**
 * Initializes an empty Model.
 */
public void initGraph() {
  graph = ModelFactory.createDefaultModel();
  documentCounter = 0;
  lang = Lang.TURTLE.getName();

  graph.setNsPrefix("oa", ns_oa);
  graph.setNsPrefix("foxo", ns_fox_ontology);
  graph.setNsPrefix("foxr", ns_fox_resource);
  graph.setNsPrefix("dbo", ns_dbpedia_ontology);
  graph.setNsPrefix("dbr", ns_dbpedia_resource);
  graph.setNsPrefix("its", ns_its);
  graph.setNsPrefix("nif", ns_nif);
  graph.setNsPrefix("prov", ns_prov);
  graph.setNsPrefix("foaf", ns_foaf);
  graph.setNsPrefix("schema", ns_schema);
  graph.setNsPrefix("xsd", XSD.getURI());
  graph.setNsPrefix("rdf", RDF.getURI());
  graph.setNsPrefix("rdfs", RDFS.getURI());
}
 
开发者ID:dice-group,项目名称:FOX,代码行数:23,代码来源:AFoxJenaNew.java


示例20: addInput

import org.apache.jena.vocabulary.XSD; //导入依赖的package包/类
/**
 * Creates document uri {@link FoxJenaNew#createDocUri(String, int, int)} for the input and adds a
 * resource with the uri and input to the graph.
 */
@Override
public void addInput(final String input, final String uri) {
  documentCounter++;
  baseuri = uri;

  if (baseuri == null) {
    baseuri = getDefaultDocumentURI();
  }

  final String currentURI = createDocUri(baseuri, 0, (input.length()));

  inputResource =
      graph.createResource(currentURI)//
          .addProperty(RDF.type, pNifContext)//
          .addLiteral(pNifBegin,
              graph.createTypedLiteral(new Integer(0), XSD.nonNegativeInteger.getURI()))//
          .addLiteral(pNifEnd,
              graph.createTypedLiteral(new Integer(input.length()),
                  XSD.nonNegativeInteger.getURI()))//
          .addLiteral(pNifIsString, input);
}
 
开发者ID:dice-group,项目名称:FOX,代码行数:26,代码来源:FoxJenaNew.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AWSSessionCredentials类代码示例发布时间:2022-05-21
下一篇:
Java BeanInstantiationException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap