當前位置: 首頁>>代碼示例>>Java>>正文


Java Model.setNsPrefix方法代碼示例

本文整理匯總了Java中com.hp.hpl.jena.rdf.model.Model.setNsPrefix方法的典型用法代碼示例。如果您正苦於以下問題:Java Model.setNsPrefix方法的具體用法?Java Model.setNsPrefix怎麽用?Java Model.setNsPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.hp.hpl.jena.rdf.model.Model的用法示例。


在下文中一共展示了Model.setNsPrefix方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setPrefixes

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
/**
    * Add the necessary prefixes to the model we are currently 
    * working with.
    * 
    * @param Model the model we are currently working with
    */
public void setPrefixes(Model model) {
	model.setNsPrefix("elod", Ontology.eLodPrefix);
	model.setNsPrefix("elodGeo", Ontology.elodGeoPrefix);
   	model.setNsPrefix("pc", Ontology.publicContractsPrefix);
   	model.setNsPrefix("skos", Ontology.skosPrefix);
   	model.setNsPrefix("gr", Ontology.goodRelationsPrefix);
   	model.setNsPrefix("rov", Ontology.regOrgPrefix);
   	model.setNsPrefix("org", Ontology.orgPrefix);
   	model.setNsPrefix("foaf", Ontology.foafPrefix);
   	model.setNsPrefix("xsd", Ontology.xsdPrefix);
   	model.setNsPrefix("dcterms", Ontology.dctermsPrefix);
   	model.setNsPrefix("dc", Ontology.dcPrefix);
   	model.setNsPrefix("pcdt", Ontology.pcdtPrefix);
   	model.setNsPrefix("vcard", Ontology.vcardPrefix);
}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:22,代碼來源:OntologyInitialization.java

示例2: setPrefixes

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
/**
 * Add the necessary prefixes to the model we are currently working with.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void setPrefixes(Model model) {
	model.setNsPrefix("elod", Ontology.eLodPrefix);
	model.setNsPrefix("elodGeo", Ontology.elodGeoPrefix);
	model.setNsPrefix("pc", Ontology.publicContractsPrefix);
	model.setNsPrefix("skos", Ontology.skosPrefix);
	model.setNsPrefix("gr", Ontology.goodRelationsPrefix);
	model.setNsPrefix("rov", Ontology.regOrgPrefix);
	model.setNsPrefix("org", Ontology.orgPrefix);
	model.setNsPrefix("foaf", Ontology.foafPrefix);
	model.setNsPrefix("xsd", Ontology.xsdPrefix);
	model.setNsPrefix("dcterms", Ontology.dctermsPrefix);
	model.setNsPrefix("dc", Ontology.dcPrefix);
	model.setNsPrefix("pcdt", Ontology.pcdtPrefix);
	model.setNsPrefix("vcard", Ontology.vcardPrefix);
}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:22,代碼來源:OntologyInitialization.java

示例3: subprojectsSellers

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
public static void subprojectsSellers() {

        //services for each table
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
        SubProjectSellersService sub = (SubProjectSellersService) ctx.getBean("subProjectSellersServiceImpl");

        List<SubProjectSellers> subProjectSeller = sub.getSubProjectSellers();

        //--------------RDF Model--------------//
        Model model = ModelFactory.createDefaultModel();
        Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
        InfModel infModel = ModelFactory.createInfModel(reasoner, model);

        model.setNsPrefix("elod", OntologySpecification.elodPrefix);
        model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);


        for (SubProjectSellers subProjectSeller1 : subProjectSeller) {
            Resource instanceSeller = infModel.createResource(OntologySpecification.instancePrefix
                    + "Organization/" + subProjectSeller1.getSellerId());
            Resource instanceSubProject = infModel.createResource(OntologySpecification.instancePrefix
                    + "Subproject/" + subProjectSeller1.getOps() + "/" + subProjectSeller1.getSubProjectId());
            infModel.add(instanceSeller, RDF.type, OntologySpecification.organizationResource);
            infModel.add(instanceSeller, RDF.type, OntologySpecification.businessResource);
            infModel.add(instanceSubProject, RDF.type, OntologySpecification.subProjectResource);
            instanceSubProject.addProperty(OntologySpecification.seller, instanceSeller);
        }

        try {
            FileOutputStream fout = new FileOutputStream(
                    "/Users/giovaf/Documents/yds_pilot1/espa_tests/22-02-2016_ouput/subProjectSellersEspa.rdf");
            model.write(fout);
        } catch (IOException e) {
            System.out.println("Exception caught" + e.getMessage());
        }
    }
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:37,代碼來源:SubprojectsSellersImpl.java

示例4: espaSellers

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
public static void espaSellers() {

        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
        SellersService sellers = (SellersService) ctx.getBean("sellersServiceImpl");

        List<Sellers> seller = sellers.getSellers();

        //--------------RDF Model--------------//
        Model model = ModelFactory.createDefaultModel();
        Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
        InfModel infModel = ModelFactory.createInfModel(reasoner, model);

        model.setNsPrefix("elod", OntologySpecification.elodPrefix);
        model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);
        model.setNsPrefix("vcard", OntologySpecification.vcardPrefix);

        for (Sellers seller1 : seller) {
            Resource instanceSeller = infModel.createResource(OntologySpecification.instancePrefix + "Organization/" + seller1.getId());
            infModel.add(instanceSeller, RDF.type, OntologySpecification.organizationResource);
            instanceSeller.addProperty(OntologySpecification.name, seller1.getEponimia(), XSDDatatype.XSDstring);
        }

        try {
            FileOutputStream fout = new FileOutputStream(
                    "/Users/giovaf/Documents/yds_pilot1/espa_tests/22-02-2016_ouput/sellersEspa.rdf");
            model.write(fout);
        } catch (IOException e) {
            System.out.println("Exception caught" + e.getMessage());
        }
    }
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:31,代碼來源:SellersImpl.java

示例5: setPrefixes

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
private static void setPrefixes(Model model) {

        model.setNsPrefix(DAQ.PREFIX, DAQ.NS);
        model.setNsPrefix(DQV.PREFIX, DQV.NS);
        model.setNsPrefix(QMO.PREFIX, QMO.NS);
        model.setNsPrefix(LDQ.PREFIX, LDQ.NS);
        model.setNsPrefix(EVAL.PREFIX, EVAL.NS);
        model.setNsPrefix(SKOS.PREFIX, SKOS.NS);
        model.setNsPrefix(PROV.PREFIX, PROV.NS);
        model.setNsPrefix(QPRO.PREFIX, QPRO.NS);
        model.setNsPrefix(HTTP.PREFIX, HTTP.NS);
        model.setNsPrefix(OM.PREFIX, OM.NS);
        model.setNsPrefix("rdf", RDF.getURI());
        model.setNsPrefix("dc", DC_11.getURI());
        model.setNsPrefix("dcterms", DCTerms.getURI());
        model.setNsPrefix("xsd", XSD.getURI());
        model.setNsPrefix("owl", OWL.getURI());
        model.setNsPrefix("dqm", "http://www.diachron-fp7.eu/dqm#");
        model.setNsPrefix("dbr", "http://dbpedia.org/resource/");
        model.setNsPrefix("uri4uri", "http://uri4uri.net/vocab#");
        model.setNsPrefix("derivedmeasure", "http://linkeddata.es/resource/ldqm/DerivedMeasure/");
        model.setNsPrefix("basemeasure", "http://linkeddata.es/resource/ldqm/BaseMeasure/");
        model.setNsPrefix("indicator", "http://linkeddata.es/resource/ldqm/QualityIndicator/");
        model.setNsPrefix("category", "http://linkeddata.es/resource/ldqm/SubjectCategory/");
        model.setNsPrefix("dimension", "http://linkeddata.es/resource/ldqm/Dimension/");
        model.setNsPrefix("defect", "http://linkeddata.es/resource/ldqm/Defect/");
        model.setNsPrefix("scale", "http://linkeddata.es/resource/ldqm/Scale/");
        model.setNsPrefix("technique", "http://linkeddata.es/resource/ldqm/AssessmentTechnique/");
        model.setNsPrefix("measure", "http://linkeddata.es/resource/ldqm/measure/");
        model.setNsPrefix("evaluation", "http://linkeddata.es/resource/ldqm/evaluation/");
        model.setNsPrefix("report", "http://linkeddata.es/resource/ldqm/report/");

    }
 
開發者ID:nandana,項目名稱:ld-sniffer,代碼行數:34,代碼來源:Executor.java

示例6: createModel

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
private Model createModel() {
  Model model = ModelFactory.createDefaultModel();
  String NS = "http://www.computas.no/zebra/";
  model.setNsPrefix("", NS);
  model.setNsPrefix("xsd", "http://www.w3.org/2001/XMLSchema#");
  Resource subject = model.createResource(NS + "Joe");
  Property predicate = model.createProperty(NS + "hasSentMessage");
  String object = "Hello World!";
  subject.addProperty(predicate, object, XSDDatatype.XSDstring);
  return model;
}
 
開發者ID:mehmandarov,項目名稱:zebra-puzzle-workshop,代碼行數:12,代碼來源:Exercise2.java

示例7: createModel

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
private Model createModel() {
  Model model = ModelFactory.createDefaultModel();
  String NS = "http://www.computas.no/zebra/";
  model.setNsPrefix("", NS);
  model.setNsPrefix("xsd", "http://www.w3.org/2001/XMLSchema#");
  //TODO
  return model;
}
 
開發者ID:mehmandarov,項目名稱:zebra-puzzle-workshop,代碼行數:9,代碼來源:Exercise2.java

示例8: espaSubprojects

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
public static void espaSubprojects() throws ParseException {

        //services for each table
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
        SubProjectsService sub = (SubProjectsService) ctx.getBean("subProjectsServiceImpl");

        List<SubProjects> subProject = sub.getSubProjects();

        //--------------RDF Model--------------//
        Model model = ModelFactory.createDefaultModel();
        Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
        InfModel infModel = ModelFactory.createInfModel(reasoner, model);

        model.setNsPrefix("elod", OntologySpecification.elodPrefix);
        model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);
        model.setNsPrefix("dcterms", OntologySpecification.dctermsPrefix);

        //number format
        DecimalFormat df = new DecimalFormat("0.00");

        for (SubProjects subProject1 : subProject) {

            Resource instanceCurrency = infModel.createResource("http://linkedeconomy.org/resource/Currency/EUR");
            Resource instanceBudgetUps = infModel.createResource(OntologySpecification.instancePrefix
                    + "UnitPriceSpecification/BudgetItem/" + subProject1.getOps() + "/" + subProject1.getId());
            Resource instanceBudget = infModel.createResource(OntologySpecification.instancePrefix + "BudgetItem/" + subProject1.getOps() + "/" + subProject1.getId());
            Resource instanceSubProject = infModel.createResource(OntologySpecification.instancePrefix + "Subproject/" + subProject1.getOps() + "/" + subProject1.getId());
            Resource instanceProject = infModel.createResource(OntologySpecification.instancePrefix
                    + "Subsidy/" + subProject1.getOps());
            DateFormat dfDate = new SimpleDateFormat("dd/MM/yyyy");
            DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
            java.util.Date stDateStarts;
            java.util.Date stDateEnds;
            stDateStarts = dfDate.parse(subProject1.getStart());
            stDateEnds = dfDate.parse(subProject1.getFinish());
            String startDate = df2.format(stDateStarts);
            String endDate = df2.format(stDateEnds);
            infModel.add(instanceProject, RDF.type, OntologySpecification.projectResource);
            infModel.add(instanceBudgetUps, RDF.type, OntologySpecification.priceSpecificationResource);
            infModel.add(instanceBudget, RDF.type, OntologySpecification.budgetResource);
            infModel.add(instanceSubProject, RDF.type, OntologySpecification.subProjectResource);
            instanceProject.addProperty(OntologySpecification.hasRelatedProject, instanceSubProject);
            instanceSubProject.addProperty(OntologySpecification.hasRelatedBudgetItem, instanceBudget);
            instanceBudget.addProperty(OntologySpecification.price, instanceBudgetUps);
            instanceBudgetUps.addProperty(OntologySpecification.hasCurrencyValue, df.format(subProject1.getBudget()), XSDDatatype.XSDfloat);
            instanceBudgetUps.addProperty(OntologySpecification.valueAddedTaxIncluded, "true", XSDDatatype.XSDboolean);
            instanceBudgetUps.addProperty(OntologySpecification.hasCurrency, instanceCurrency);
            instanceSubProject.addProperty(OntologySpecification.startDate, startDate, XSDDatatype.XSDdateTime);
            instanceSubProject.addProperty(OntologySpecification.endDate, endDate, XSDDatatype.XSDdateTime);
            instanceSubProject.addProperty(OntologySpecification.title, String.valueOf(subProject1.getTitle()), "el");
        }

        try {
            FileOutputStream fout = new FileOutputStream(
                    "/Users/giovaf/Documents/yds_pilot1/espa_tests/22-02-2016_ouput/subProjectEspa.rdf");
            model.write(fout);
        } catch (IOException e) {
            System.out.println("Exception caught" + e.getMessage());
        }
    }
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:61,代碼來源:SubProjectsImpl.java

示例9: espaBuyers

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
public static void espaBuyers() {

        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
        BuyersService buyers = (BuyersService) ctx.getBean("buyersServiceImpl");

        List<Buyers> buyer = buyers.getBuyers();
        List<Buyer> projectBuyer = buyers.getProjectBuyers();

        //--------------RDF Model--------------//
        Model model = ModelFactory.createDefaultModel();
        Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
        InfModel infModel = ModelFactory.createInfModel(reasoner, model);

        model.setNsPrefix("elod", OntologySpecification.elodPrefix);
        model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);
        model.setNsPrefix("vcard", OntologySpecification.vcardPrefix);

        for (Buyer projectBuyer1 : projectBuyer) {

            Resource instanceBuyer = infModel.createResource(OntologySpecification.instancePrefix + "Organization/" + projectBuyer1.getBuyerId());
            Resource instanceProject = infModel.createResource(OntologySpecification.instancePrefix + "Subsidy/" + projectBuyer1.getOps());


            infModel.add(instanceBuyer, RDF.type, OntologySpecification.organizationResource);
            infModel.add(instanceProject, RDF.type, OntologySpecification.subsidyResource);

            instanceProject.addProperty(OntologySpecification.beneficiary, instanceBuyer);
            instanceBuyer.addProperty(OntologySpecification.name, String.valueOf(projectBuyer1.getEponimia()), XSDDatatype.XSDstring);

        }


        try {
            FileOutputStream fout = new FileOutputStream(
                    "/Users/giovaf/Documents/yds_pilot1/espa_tests/22-02-2016_ouput/buyersEspa.rdf");
            // /home/svaf/buyersEspa.rdf
            // /Users/giovaf/Documents/yds_pilot1/espa_tests/06-01-2016_output/buyersEspa.rdf
            model.write(fout);
        } catch (IOException e) {
            System.out.println("Exception caught" + e.getMessage());
        }
    }
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:43,代碼來源:BuyersImpl.java

示例10: exportRfd

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
/**
 *
 * Implementation Of Subproject Service layer 
 * and transformation of Database data to RDF
 *
 * @throws java.text.ParseException
 * @throws java.io.UnsupportedEncodingException
 * @throws java.io.FileNotFoundException
 */

public static void exportRfd() throws ParseException, UnsupportedEncodingException, FileNotFoundException, IOException {

    //services for each table
    ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
    SubProjectsService sub = (SubProjectsService) ctx.getBean("subProjectsServiceImpl");

    List<SubprojectsProjects> subProject = sub.getInfoSubproject();

    //--------------RDF Model--------------//
    Model model = ModelFactory.createDefaultModel();
    Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
    InfModel infModel = ModelFactory.createInfModel(reasoner, model);

    model.setNsPrefix("elod", OntologySpecification.elodPrefix);
    model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);
    model.setNsPrefix("dcterms", OntologySpecification.dctermsPrefix);

    //number format
    DecimalFormat df = new DecimalFormat("0.00");
    
    for (SubprojectsProjects subProject1 : subProject) {

        Resource instanceCurrency = infModel.createResource("http://linkedeconomy.org/resource/Currency/EUR");
        Resource instanceUps = infModel.createResource(OntologySpecification.instancePrefix
                + "UnitPriceSpecification/" + subProject1.getOps() + "/" + subProject1.getSubprojectId());
        Resource instanceBudget = infModel.createResource(OntologySpecification.instancePrefix + "BudgetItem/" + subProject1.getOps() + "/" + subProject1.getSubprojectId());
        Resource instanceSubProject = infModel.createResource(OntologySpecification.instancePrefix + "Contract/" + subProject1.getOps() + "/" + subProject1.getSubprojectId());
        Resource instanceProject = infModel.createResource(OntologySpecification.instancePrefix
                + "PublicWork/" + subProject1.getOps());

        infModel.add(instanceUps, RDF.type, OntologySpecification.priceSpecificationResource);
        infModel.add(instanceBudget, RDF.type, OntologySpecification.budgetResource);
        infModel.add(instanceSubProject, RDF.type, OntologySpecification.contractResource);
        instanceProject.addProperty(OntologySpecification.hasRelatedContract, instanceSubProject);
        instanceSubProject.addProperty(OntologySpecification.price, instanceUps);
        instanceUps.addProperty(OntologySpecification.hasCurrencyValue, df.format(subProject1.getBudget()), XSDDatatype.XSDfloat);
        instanceUps.addProperty(OntologySpecification.valueAddedTaxIncluded, "true", XSDDatatype.XSDboolean);
        instanceUps.addProperty(OntologySpecification.hasCurrency, instanceCurrency);
        if (subProject1.getStart() != null) {
            instanceSubProject.addProperty(OntologySpecification.pcStartDate, subProject1.getStart().replace("/", "-"), XSDDatatype.XSDdate);
        }
        if (subProject1.getFinish() != null) {
            instanceSubProject.addProperty(OntologySpecification.actualEndDate, subProject1.getFinish().replace("/", "-"), XSDDatatype.XSDdate);
        }
        instanceSubProject.addProperty(OntologySpecification.title, String.valueOf(subProject1.getTitle()), "el");
    }

    try {
        FileOutputStream fout = new FileOutputStream(
                CommonVariables.serverPath + "subProjectEspa_"+ CommonVariables.currentDate + ".rdf");
        model.write(fout);
        fout.close();
    } catch (IOException e) {
        System.out.println("Exception caught" + e.getMessage());
    }
}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:67,代碼來源:SubProjectsImpl.java

示例11: testUsePrefixMappingWhenPrintingURIResources

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
@Test
public void testUsePrefixMappingWhenPrintingURIResources() {
	Model m = ModelFactory.createDefaultModel();
	m.setNsPrefix("ex", "http://example.org/");
	assertEquals("ex:foo", PrettyPrinter.toString(m.createResource("http://example.org/foo")));
}
 
開發者ID:d2rq,項目名稱:r2rml-kit,代碼行數:7,代碼來源:PrettyPrinterTest.java

示例12: doGet

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
protected void doGet(HttpServletRequest request,
		HttpServletResponse response) throws IOException, ServletException {
	D2RServer server = D2RServer.fromServletContext(getServletContext());
	server.checkMappingFileChanged();
	String relativeResourceURI = request.getRequestURI().substring(
			request.getContextPath().length()
					+ request.getServletPath().length());
	// Some servlet containers keep the leading slash, some don't
	if (!"".equals(relativeResourceURI)
			&& "/".equals(relativeResourceURI.substring(0, 1))) {
		relativeResourceURI = relativeResourceURI.substring(1);
	}
	if (request.getQueryString() != null) {
		relativeResourceURI = relativeResourceURI + "?"
				+ request.getQueryString();
	}

	/* Determine service stem, i.e. vocab/ in /[vocab/]data */
	int servicePos;
	if (-1 == (servicePos = request.getServletPath().indexOf(
			"/" + D2RServer.getDataServiceName())))
		throw new ServletException("Expected to find service path /"
				+ D2RServer.getDataServiceName());
	String serviceStem = request.getServletPath().substring(1,
			servicePos + 1);

	String resourceURI = RequestParamHandler
			.removeOutputRequestParam(server.resourceBaseURI(serviceStem)
					+ relativeResourceURI);
	String documentURL = server.dataURL(serviceStem, relativeResourceURI);

	String pageURL = server.pageURL(serviceStem, relativeResourceURI);

	String sparqlQuery = "DESCRIBE <" + resourceURI + ">";
	QueryExecution qe = QueryExecutionFactory.create(sparqlQuery,
			server.dataset());
	if (server.getConfig().getPageTimeout() > 0) {
		qe.setTimeout(Math.round(server.getConfig().getPageTimeout() * 1000));
	}
	Model description = qe.execDescribe();
	qe.close();
	
	if (description.size() == 0) {
		response.sendError(404);
	}
	if (description.qnameFor(FOAF.primaryTopic.getURI()) == null
			&& description.getNsPrefixURI("foaf") == null) {
		description.setNsPrefix("foaf", FOAF.NS);
	}
	Resource resource = description.getResource(resourceURI);

	Resource document = description.getResource(documentURL);
	document.addProperty(FOAF.primaryTopic, resource);

	Statement label = resource.getProperty(RDFS.label);
	if (label != null) {
		document.addProperty(RDFS.label,
				"RDF Description of " + label.getString());
	}
	server.addDocumentMetadata(description, document);
	if (server.getConfig().serveMetadata()) {
		// add document metadata from template
		Model resourceMetadataTemplate = server.getConfig().getResourceMetadataTemplate(
				server, getServletContext());
		MetadataCreator resourceMetadataCreator = new MetadataCreator(
				server, resourceMetadataTemplate);
		description.add(resourceMetadataCreator.addMetadataFromTemplate(
				resourceURI, documentURL, pageURL));
		
		Map<String, String> descPrefixes = description.getNsPrefixMap();
		descPrefixes.putAll(resourceMetadataTemplate.getNsPrefixMap());
		description.setNsPrefixes(descPrefixes);
	}
	// TODO: Add a Content-Location header
	new ModelResponse(description, request, response).serve();
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:77,代碼來源:ResourceDescriptionServlet.java

示例13: testUsePrefixMappingWhenPrintingURIResources

import com.hp.hpl.jena.rdf.model.Model; //導入方法依賴的package包/類
public void testUsePrefixMappingWhenPrintingURIResources() {
	Model m = ModelFactory.createDefaultModel();
	m.setNsPrefix("ex", "http://example.org/");
	assertEquals("ex:foo", PrettyPrinter.toString(m.createResource("http://example.org/foo")));
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:6,代碼來源:PrettyPrinterTest.java


注:本文中的com.hp.hpl.jena.rdf.model.Model.setNsPrefix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。