首页 \ 问答 \ 可以在MarkLogic中将RDF与JSON一起使用吗?(Can RDF be used with JSON in MarkLogic?)

可以在MarkLogic中将RDF与JSON一起使用吗?(Can RDF be used with JSON in MarkLogic?)

据我所知,MarkLogic将RDF存储为XML。 但是如果我需要将RDF与JSON文档结合使用该怎么办呢? 如何使用RDF为JSON文档建模? 如果这是可能的,我如何一起查询JSON和RDF? 提前致谢。


As per my knowledge, MarkLogic stores RDF as XMLs. But what if I need to use RDF in conjunction with JSON documents. How would I model my JSON documents with RDF? Also if this is possible how do I query JSON and RDF together? Thanks in advance.


原文:https://stackoverflow.com/questions/45730898
更新时间:2022-10-05 14:10

最满意答案

int i = 1;
out.write(i);

0x1写入文件。

out.flush();
out.close();

flush()是多余的。

一些二进制数据已在文件中写入。

正确。

但是当我将i的值从1更改为10时,对于相同的程序。我的输出文件中没有看到任何内容。

是的你是。 你看到0xa ,这是一个换行符。


int i = 1;
out.write(i);

That writes 0x1 to the file.

out.flush();
out.close();

The flush() is redundant.

Some binary data has been writen in the file.

Correct.

But the for the same program when I change the value of i from 1 to 10. I don't see anything in my output file.

Yes you do. You see 0xa, which is a line feed character.

相关问答

更多
  • 使用构造函数获取File和boolean FileOutputStream(File file, boolean append) 并将布尔值设置为true 。 这样,您写入的数据将被附加到文件的末尾,而不是覆盖已经存在的数据。 Use the constructor that takes a File and a boolean FileOutputStream(File file, boolean append) and set the boolean to true. That way, the ...
  • 您可以使用ObjectOutputStream编写任何Serializable对象,它们以与编写它们相同的顺序存储,并且也应该以这种方式读取: 可以将多个对象或基元写入流中。 必须从相应的ObjectInputstream中读取对象,这些对象具有与写入时相同的类型和顺序。 (来源: ObjectOutputStream ) You can write any Serializable object with the ObjectOutputStream, they are stored in the sam ...
  • 您还应该查看RandomAccessFile类,它将允许您寻找某个位置并从那里开始写入而不截断文件。 You should also take a look at the RandomAccessFile class, which will let you seek to a certain position and start writing from there without truncating the file.
  • 在处理流时,您经常会以块的形式读取字节。 如果你逐个读/写字节,那么每个字节都有很多开销(比如init存储字节的数组,存储字节,把字节流,记住文件中的当前位置等等)。 所以如果你读了一组字节,你仍然有那些开销但是更少(例如,如果你有4000字节,你有4000倍的开销,但是如果你每次读100字节,你只有4000/100 = 40x开销) 经常选择块的长度以在读取/写入块的时间和块的大小之间进行平衡。 它通常设置为2k或4k。 可能与磁盘扇区有关(512字节,2048字节...) When deal with ...
  • 您忘记传递构造函数参数来指定您需要将数据附加到文件。 pOUTPUT = new FileOutputStream(DefaultLogFileLocation, true); 另外,为什么你不使用一些Java日志框架? 例如java.util.logging或log4j 要写入文件的log4j配置示例:
  • 文件包含字节。 总是。 通过使用编码将字符转换为字节,将字符写入文件。 存在许多这样的编码。 例如,ASCII允许将128个不同的字符转换为字节。 UTF-8允许将任何Unicode字符编码为字节。 例如,这两种编码将字符'1'变换为字节49.'2'将被变换为字节50。 使用带有文件名作为参数的PrintWriter时,PrintWriter实际上会打开FileOuptutStream以将字节写入文件。 当您将字符写入PrintWriter时,PrintWriter使用编码将字符转换为字节,然后将这些字节写 ...
  • int i = 1; out.write(i); 将0x1写入文件。 out.flush(); out.close(); flush()是多余的。 一些二进制数据已在文件中写入。 正确。 但是当我将i的值从1更改为10时,对于相同的程序。我的输出文件中没有看到任何内容。 是的你是。 你看到0xa ,这是一个换行符。 int i = 1; out.write(i); That writes 0x1 to the file. out.flush(); out.close(); The flush() i ...
  • 要做到这一点,您需要随时刷新输出流。 public class TempFile2 { private File file; private File tempFile; private FileOutputStream os; public TempFile2(File file) { this.file = file; this.tempFile = new File(file.getParent(), FilenameUtil ...
  • 只需推迟创建FileOutputStream和PrintWriter直到需要它为止: PrintWriter pw = null; Process proc = Runtime.getRuntime().exec(externalProgram); InputStreamReader isr = new InputStreamReader(proc.getErrorStream()); BufferedReader br = new BufferedReader(isr); String line; w ...
  • 这就是问题: Attempting to write output directory D:\TestFile\1.png 您已将目标文件名创建为目录 。 您需要将“我需要存在的目录”和“我要写入的文件”分开。 例如: File outputFile = new File(outputDir, tarEntry.getName()); File outputDirectory = outputFile.getParent(); if (!outputDirectory.exists()) { // ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。