本文整理了Java中com.hp.hpl.jena.rdf.model.Model.getWriter()
方法的一些代码示例,展示了Model.getWriter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.getWriter()
方法的具体详情如下:
包路径:com.hp.hpl.jena.rdf.model.Model
类名称:Model
方法名:getWriter
暂无
代码示例来源:origin: fr.inria.eventcloud/eventcloud-api
/**
* {@inheritDoc}
*/
@Override
public RDFWriter getWriter(String lang) {
return super.object.getWriter(lang);
}
代码示例来源:origin: fr.inria.eventcloud/eventcloud-api
/**
* {@inheritDoc}
*/
@Override
public RDFWriter getWriter() {
return super.object.getWriter();
}
代码示例来源:origin: bio2rdf/bio2rdf-scripts
public RDFWriter getWriter(String lang) {
return model.getWriter(lang);
}
代码示例来源:origin: bio2rdf/bio2rdf-scripts
public RDFWriter getWriter() {
return model.getWriter();
}
代码示例来源:origin: apache/stanbol
public ByteArrayOutputStream toStream(Model t, String mediaType) {
log.debug("Serializing model to {}. Statements are {}", mediaType, t.listStatements().toSet().size());
ByteArrayOutputStream stream = new ByteArrayOutputStream();
if (mediaType.equals("application/rdf+xml")) {
t.write(stream);
} else if (mediaType.equals("application/turtle")) {
// t.write(stream, "TURTLE");
RDFWriter writer = t.getWriter("TURTLE");
log.debug("Writer for TURTLE: {}", writer);
writer.write(t, stream, null);
} else if (mediaType.equals("text/turtle")) {
t.write(stream, "TURTLE");
} else if (mediaType.equals("text/plain")) {
t.write(stream, "TURTLE");
} else if (mediaType.equals("text/n3")) {
t.write(stream, "N3");
}
if(log.isDebugEnabled()){
log.debug("Written {} bytes to stream", stream.toByteArray().length);
}
return stream;
}
代码示例来源:origin: org.w3/ldp-testsuite
@Override
public Object serialize(ObjectMapperSerializationContext context) {
Model model = context.getObjectToSerializeAs(Model.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
String lang = getLang(context.getContentType());
RDFWriter rdfWriter = model.getWriter(lang);
rdfWriter.setProperty("relativeURIs", "same-document");
rdfWriter.setProperty("allowBadURIs", "true");
rdfWriter.write(model, out, baseURI);
return out.toByteArray();
}
}
代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core
RDFWriter w = m.getWriter(outlang);
j++;
for (; j < lastOutProp; j++) {
代码示例来源:origin: stackoverflow.com
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFWriter;
public class ChangeBase {
public static void main(String[] args) throws IOException {
final String NS = "http://example.org/";
final String text = "" +
"@prefix ex: <"+NS+">.\n" +
"ex:foo a ex:Foo .\n" +
"ex:foo ex:frob ex:bar.\n";
final Model model = ModelFactory.createDefaultModel();
try ( final InputStream in = new ByteArrayInputStream( text.getBytes() )) {
model.read( in, null, "TTL" );
}
// get a writer for RDF/XML-ABBREV, set its xmlbase to the NS, and write the model
RDFWriter writer = model.getWriter( "RDF/XML-ABBREV" );
writer.setProperty( "xmlbase", NS );
writer.write( model, System.out, null );
// change the base to example.com (.com, not .org) and write again
writer.setProperty( "xmlbase", "http://example.com" );
writer.write( model, System.out, null );
}
}
代码示例来源:origin: culturecommunication/ginco
RDFWriter w = model.getWriter("RDF/XML-ABBREV");
w.setProperty("tab", 4);
w.setProperty("prettyTypes", rootTypes.toArray(new Resource[rootTypes.size()]));
代码示例来源:origin: org.apache.juneau/juneau-marshall-rdf
pRoot = model.createProperty(ctx.getJuneauNs().getUri(), RDF_juneauNs_ROOT);
pValue = model.createProperty(ctx.getJuneauNs().getUri(), RDF_juneauNs_VALUE);
writer = model.getWriter(ctx.getRdfLanguage());
代码示例来源:origin: com.hp.hpl.jena/arq
RDFWriter rdfw = m.getWriter("TURTLE") ;
m.setNsPrefix("rs", ResultSetGraphVocab.getURI()) ;
rdfw.write(m, System.out, null) ;
代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq
RDFWriter rdfw = m.getWriter("TURTLE") ;
m.setNsPrefix("rs", ResultSetGraphVocab.getURI()) ;
rdfw.write(m, System.out, null) ;
内容来源于网络,如有侵权,请联系作者删除!