tsv

Is there a Java open source implementation of R2RML?

ぐ巨炮叔叔 提交于 2019-11-30 19:05:49
I want to generate RDF data from tabular data, in particular: CSV, TSV, spreadsheets (either Excel or OpenOffice) and, eventually, tables in RDBMS. I am aware of the "RDB to RDF Mapping Language" (R2RML) (http://www.w3.org/TR/r2rml/) current draft. I use Apache Jena for processing, storing and querying RDF data and/or reading CSV or TSV files. I use Apache POI for reading Microsoft Excel spreadsheets and I am planning to use Apache ODF Toolkit for reading OpenOffice spreadsheets. Is there a Java open source (preferably ASL) implementation of R2RML I can use? D2RQ is the underling

How to import CSV/TSV data to Couch DB?

不问归期 提交于 2019-11-30 06:58:31
问题 How to import CSV/TSV data to Couch DB? 回答1: Its pretty easy with python. #!/usr/bin/env python from couchdbkit import Server, Database from couchdbkit.loaders import FileSystemDocsLoader from csv import DictReader import sys, subprocess, math, os def parseDoc(doc): for k,v in doc.items(): if (isinstance(v,str)): #print k, v, v.isdigit() # #see if this string is really an int or a float if v.isdigit()==True: #int doc[k] = int(v) else: #try a float try: if math.isnan(float(v))==False: doc[k] =

converting a d3.csv method to d3.csv.parse method

人走茶凉 提交于 2019-11-30 06:53:42
I just need to draw a d3 barchart of data retrieved from an sql query, so I don't have a tsv or csv file but a string of data in csv format. I know I can use d3.csv.parse method but somehow I couldn't figure out how to convert the example code for the csv bar chart using the data from a file to csv.parse method for data contained in a string variable. here is the example code for csv file: d3.csv("data.csv", type, function(error, data) { x.domain(data.map(function(d) { return d.letter; })); y.domain([0, d3.max(data, function(d) { return d.frequency; })]); here is the sample data for testing

How to import a tsv file with SQLite3

╄→尐↘猪︶ㄣ 提交于 2019-11-30 06:24:41
问题 I have a tsv (tab separated file) that I would like to import with sqlite3. Does someone know a clear way to do it? I have installed sqlite3, but not created any database or tables yet. I've tried the command .import /path/filename.tsv my_new_table but it gives me the error: no such table: my_new_table. However, from what I'd read it should create the table automatically if it does't exist. Does it mean I need to create and use a database first, or is there another trick to importing a .tsv

How do I convert a .tsv to .csv?

廉价感情. 提交于 2019-11-30 05:07:42
问题 Trying to convert a .tsv to a .csv. This: import csv # read tab-delimited file with open('DataS1_interactome.tsv','rb') as fin: cr = csv.reader(fin, delimiter='\t') filecontents = [line for line in cr] # write comma-delimited file (comma is the default delimiter) with open('interactome.csv','wb') as fou: cw = csv.writer(fou, quotechar='', quoting=csv.QUOTE_NONE) cw.writerows(filecontents) Gives me this error: File "tsv2csv.py", line 11, in <module> cw.writerows(filecontents) _csv.Error: need

Is there a Java open source implementation of R2RML?

我与影子孤独终老i 提交于 2019-11-30 03:36:56
问题 I want to generate RDF data from tabular data, in particular: CSV, TSV, spreadsheets (either Excel or OpenOffice) and, eventually, tables in RDBMS. I am aware of the "RDB to RDF Mapping Language" (R2RML) (http://www.w3.org/TR/r2rml/) current draft. I use Apache Jena for processing, storing and querying RDF data and/or reading CSV or TSV files. I use Apache POI for reading Microsoft Excel spreadsheets and I am planning to use Apache ODF Toolkit for reading OpenOffice spreadsheets. Is there a

PHP to write Tab Characters inside a file?

安稳与你 提交于 2019-11-30 03:07:48
How do i simply write out a file including real tabs inside? tab means real tab which is not the spaces . How to write the tab or what is the character for real tab ? For example here: $chunk = "a,b,c"; file_put_contents("chunk.csv",$chunk); What character should i use to get tabs instead of Commas (,) there? In the output file, there should be real tabs between the seperated words. Real Tabs means, a true wide space we get when we press the <tab> key in a text-editor. The tab character is \t . Notice the use of " instead of ' . $chunk = "abc\tdef\tghi"; PHP Strings - Double quoted If the

read csv/tsv with no header line in D3

那年仲夏 提交于 2019-11-27 12:44:31
I have CSV data which looks something like: Data 1,1,10 1,2,50 1,3,5 etc... And I am trying to read in the data. However, my initial data does not contain a header row (as seen above) so it is taking the first data row to be the header (1,1,10). Is there anyway around this. I want to set the header names after I read the data Javascript d3.csv("data/testnh.csv", function(data) { console.log(data); } Thanks! mbostock Use d3.text to load the data, and then d3.csvParseRows to parse it. For example: d3.text("data/testnh.csv", function(text) { console.log(d3.csvParseRows(text)); }); You'll probably

read csv/tsv with no header line in D3

。_饼干妹妹 提交于 2019-11-26 18:13:36
问题 I have CSV data which looks something like: Data 1,1,10 1,2,50 1,3,5 etc... And I am trying to read in the data. However, my initial data does not contain a header row (as seen above) so it is taking the first data row to be the header (1,1,10). Is there anyway around this. I want to set the header names after I read the data Javascript d3.csv("data/testnh.csv", function(data) { console.log(data); } Thanks! 回答1: Use d3.text to load the data, and then d3.csvParseRows to parse it. For example: