воскресенье, 8 августа 2010 г.
Похолодало
Сегодня был один из самых прохладных дней за все лето. Днем мой градусник показывал всего +45 на солнце (обычно все +50), а вечером температура упала до +33. На улице можно было дышать и даже гулять.
среда, 4 августа 2010 г.
First results of test - mp3 (id3v2)
Old ID3EndAnalyzer:
./Rammstein - Mann gegen Mann.mp3
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment
"[Xakep Online] ";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentCreated
"2005";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"7096320";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1230225080";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"audio/mpeg",
"audio/mpeg";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Mann gegen Mann";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator
"Rammstein";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#publisher
":nwlrb";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#averageBitrate
"128000";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#channels
"2";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#codec
"MP3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#sampleRate
"44100";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#genre
"Rock";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicAlbum
":bmqbh";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#trackNumber
"2";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio",
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:bmqbh
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Rosenrot";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"LAME 3.90.3+mod";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact".
Generated Mp3EndAnalyzer by Translator:
./Rammstein - Mann gegen Mann.mp3
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"7096320";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1230225080";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"audio/mpeg",
"audio/mpeg";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Mann gegen Mann";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#publisher
":cdarz";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#composer
":hiddq";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#genre
"(17)";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#lyricist
":owkky";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicAlbum
":nwlrb";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#performer
":bmqbh";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#trackNumber
"2";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicPiece",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:bmqbh
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"Rammstein";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
:cdarz
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"LAME 3.90.3+mod";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
:hiddq
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"Rammstein";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Rosenrot";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum".
:owkky
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
Extractor test:
myvector stores 9 numbers.
Name=Publisher Value = LAME 3.90.3+mod
Name=Title Value = Mann gegen Mann
Name=Publisher Value = Po-X
Name=Genre Value = (17)
Name=Album Value = Rosenrot
Name=Performer Value = Rammstein
Name=Track_number Value = 2
Name=Composer Value = Rammstein
Name=Performer Value = Rammstein
TFL input file:
Format mp3;
Metadata: id3v2, id3v1;
if(id3v2)
{
Created = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentCreated";
Subject = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#subject";
Title = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title";
Description = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#description";
Comment = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment";
Artist = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator";
Album = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicAlbum";
Genre = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#genre";
Composer = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#composer";
Performer = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#performer";
Liricist = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#lyricist";
Publisher = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#publisher";
Language = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#landuage";
Copyright = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#copyright";
Track_number = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#trackNumber";
Duration = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#duration";
Bitrate = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#averageBitrate";
Samplerate = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#sampleRate";
Codec = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#codec";
Channels = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#channels";
&type = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&fullname = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname";
&titleProperty = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title";
&albumTrackCount = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#albumTrackCount";
&discNumber = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#setNumber";
&discCount = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#setCount";
&musicClass = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicPiece";
&audioClass = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio";
&albumClass = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum";
&contactClass = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact";
Uri a, a1, a2, a3, a4;
T: a1 - type - contactClass;
T: a1 - fullname - Performer;
T: a2 - type - contactClass;
T: a2 - fullname - Publisher;
T: a - titleProperty - Album;
T: a - type - albumClass;
T: a3 - type - contactClass;
T: a3 - fullname - Liricist;
T: a4 - type - contactClass;
T: a4 - fullname - Composer;
D: type - musicClass;
D: type - audioClass;
}
TL input file:
Binary id3v2;
ByteOrder=MSB;
BitOrder=MSB;
StartMetadataKey ID3(offset=0, size=3);
checkKey(ID3)="ID3";
MetadataKey HeaderFlag(start, offset=5, size=1);
MetadataKey ID3_size(start, offset=6, size=4);
MetadataSize=getNumber(ID3_size);
if (getBit(HeaderFlag, 6)==1)
{
MetadataKey ExHeaderSize(start, offset=10, size=4);
MetadataKey FirstFrameID(start, offset=getNumber(ExHeaderSize)+10, size=4);
MetadataSize-=(10+getNumber(ExHeaderSize));
}
else
MetadataKey FirstFrameID(start, offset=10, size=4);
key=FirstFrameID;
while(MetadataSize>0)
{
MetadataKey sizeOfTag(key, offset=0, size=4);
if(getByte(key, 0)==0x00)
{
break;
}
else {
TagSize=getNumber(sizeOfTag);
if((getValue(key)=="TALB" || getValue(key)=="TOAL") && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
SetTag Album(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TCOM" && (TagSize>1))
{
MetadataKey encoding(key, offset=6, size=1);
setTag Composer(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if((getValue(key)=="TYAR" || getValue(key)=="TDRL" || getValue(key)=="TDAT" || getValue(key)=="TDRC") && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Created(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TRCK" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Track_number(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TIT2" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Title(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TIT1" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Subject(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TIT3" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Description(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if((getValue(key)=="TPE1" || getValue(key)=="TPE2" || getValue(key)=="TPE3" || getValue(key)=="TPE4")&& TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Performer(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if((getValue(key)=="TPUB" || getValue(key)=="TENC")&& TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Publisher(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TEXT" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Liricist(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TCON" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Genre(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TLAN" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Language(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TCOP" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Copyright(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TLEN" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Duration(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
MetadataSize-=(10+getNumber(sizeOfTag));
shift(key, 6+getNumber(sizeOfTag));
}
}
./Rammstein - Mann gegen Mann.mp3
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment
"[Xakep Online] ";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentCreated
"2005";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"7096320";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1230225080";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"audio/mpeg",
"audio/mpeg";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Mann gegen Mann";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator
"Rammstein";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#publisher
":nwlrb";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#averageBitrate
"128000";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#channels
"2";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#codec
"MP3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#sampleRate
"44100";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#genre
"Rock";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicAlbum
":bmqbh";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#trackNumber
"2";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio",
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:bmqbh
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Rosenrot";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"LAME 3.90.3+mod";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact".
Generated Mp3EndAnalyzer by Translator:
./Rammstein - Mann gegen Mann.mp3
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"7096320";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1230225080";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"audio/mpeg",
"audio/mpeg";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Mann gegen Mann";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#publisher
":cdarz";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"Rammstein - Mann gegen Mann.mp3";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#composer
":hiddq";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#genre
"(17)";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#lyricist
":owkky";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicAlbum
":nwlrb";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#performer
":bmqbh";
http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#trackNumber
"2";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicPiece",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:bmqbh
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"Rammstein";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
:cdarz
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"LAME 3.90.3+mod";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
:hiddq
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"Rammstein";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title
"Rosenrot";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum".
:owkky
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact".
Extractor test:
myvector stores 9 numbers.
Name=Publisher Value = LAME 3.90.3+mod
Name=Title Value = Mann gegen Mann
Name=Publisher Value = Po-X
Name=Genre Value = (17)
Name=Album Value = Rosenrot
Name=Performer Value = Rammstein
Name=Track_number Value = 2
Name=Composer Value = Rammstein
Name=Performer Value = Rammstein
TFL input file:
Format mp3;
Metadata: id3v2, id3v1;
if(id3v2)
{
Created = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentCreated";
Subject = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#subject";
Title = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title";
Description = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#description";
Comment = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment";
Artist = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator";
Album = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicAlbum";
Genre = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#genre";
Composer = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#composer";
Performer = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#performer";
Liricist = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#lyricist";
Publisher = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#publisher";
Language = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#landuage";
Copyright = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#copyright";
Track_number = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#trackNumber";
Duration = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#duration";
Bitrate = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#averageBitrate";
Samplerate = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#sampleRate";
Codec = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#codec";
Channels = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#channels";
&type = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&fullname = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname";
&titleProperty = "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title";
&albumTrackCount = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#albumTrackCount";
&discNumber = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#setNumber";
&discCount = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#setCount";
&musicClass = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#musicPiece";
&audioClass = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio";
&albumClass = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum";
&contactClass = "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#contact";
Uri a, a1, a2, a3, a4;
T: a1 - type - contactClass;
T: a1 - fullname - Performer;
T: a2 - type - contactClass;
T: a2 - fullname - Publisher;
T: a - titleProperty - Album;
T: a - type - albumClass;
T: a3 - type - contactClass;
T: a3 - fullname - Liricist;
T: a4 - type - contactClass;
T: a4 - fullname - Composer;
D: type - musicClass;
D: type - audioClass;
}
TL input file:
Binary id3v2;
ByteOrder=MSB;
BitOrder=MSB;
StartMetadataKey ID3(offset=0, size=3);
checkKey(ID3)="ID3";
MetadataKey HeaderFlag(start, offset=5, size=1);
MetadataKey ID3_size(start, offset=6, size=4);
MetadataSize=getNumber(ID3_size);
if (getBit(HeaderFlag, 6)==1)
{
MetadataKey ExHeaderSize(start, offset=10, size=4);
MetadataKey FirstFrameID(start, offset=getNumber(ExHeaderSize)+10, size=4);
MetadataSize-=(10+getNumber(ExHeaderSize));
}
else
MetadataKey FirstFrameID(start, offset=10, size=4);
key=FirstFrameID;
while(MetadataSize>0)
{
MetadataKey sizeOfTag(key, offset=0, size=4);
if(getByte(key, 0)==0x00)
{
break;
}
else {
TagSize=getNumber(sizeOfTag);
if((getValue(key)=="TALB" || getValue(key)=="TOAL") && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
SetTag Album(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TCOM" && (TagSize>1))
{
MetadataKey encoding(key, offset=6, size=1);
setTag Composer(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if((getValue(key)=="TYAR" || getValue(key)=="TDRL" || getValue(key)=="TDAT" || getValue(key)=="TDRC") && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Created(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TRCK" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Track_number(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TIT2" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Title(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TIT1" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Subject(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TIT3" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Description(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if((getValue(key)=="TPE1" || getValue(key)=="TPE2" || getValue(key)=="TPE3" || getValue(key)=="TPE4")&& TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Performer(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if((getValue(key)=="TPUB" || getValue(key)=="TENC")&& TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Publisher(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TEXT" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Liricist(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TCON" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Genre(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TLAN" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Language(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TCOP" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Copyright(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
if(getValue(key)=="TLEN" && TagSize>1)
{
MetadataKey encoding(key, offset=6, size=1);
setTag Duration(getStringByLink(encoding, offset=0, size=getNumber(sizeOfTag)-1));
}
MetadataSize-=(10+getNumber(sizeOfTag));
shift(key, 6+getNumber(sizeOfTag));
}
}
First results of test - png
Old PngEndAnalyzer:
./2.png
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"145620";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1278429356";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"32";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"415";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"None";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"800";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
Generated PngEndAnalyzer by Translator:
./2.png
http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm
"6";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"145620";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1278429356";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator
":nwlrb";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"32";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"415";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"0";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"800";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact".
Extractor test:
myvector stores 7 numbers.
Name=Width Value = 800
Name=Height Value = 415
Name=Color_type Value = 8
Name=Compression_method Value = 6
Name=ColorDept Value = 32
Name=Filter_method Value = 0
Name=Interlace_method Value = 0
TFL input file:
Format Png;
Metadata: PngChunk;
if(PngChunk)
{
Width = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width";
Height = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height";
ColorDepth= "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth";
Compression_method = "http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm";
Interlace_method = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode";
Title="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title";
Author="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator";
Description="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#description";
Copyright="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#copyright";
Creation_time="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentCreated";
Software="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#generator";
Dislaimer="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#disclaimer";
Warning="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment";
Source="http://www.semanticdesktop.org/ontologies/2007/05/10/nexif#model";
Comment="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment";
&type="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&fullname="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname";
&contactClass= "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact";
&rasterImage = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage";
Uri a;
T: a - type - contactClass;
T: a - fullname - Author;
D: type - rasterImage;
}
TL input file:
Binary PngChunk;
ByteOrder=MSB;
BitOrder=MSB;
StartMetadataKey MagicHex(offset=0, size=8);
checkKey(MagicHex)=0x89504e470d0a1a0a;
MetadataKey length(MagicHex, offset=0, size=4);
MetadataKey chunkname(length, offset=0, size=4);
MetadataKey data(chunkname, offset=0, size=getNumber(length));
MetadataKey crc(data, offset=0, size=4);
while(getValue(chunkname)!="IEND")
{
if(getValue(chunkname)=="IHDR")
{
MetadataKey width(chunkname, offset=0, size=4);
SetTag Width(getNumber(width));
MetadataKey height(width, offset=0, size=4);
SetTag Height(getNumber(height));
MetadataKey ColorType(height, offset=0, size=1);
SetTag Color_type(getNumber(ColorType));
MetadataKey Compression(ColorType, offset=0, size=1);
SetTag Compression_method(getNumber(Compression));
if(getNumber(Compression)==2)
{
n=3*getNumber(ColorType);
SetTag ColorDepth(n);
}
if(getNumber(Compression)==4)
{
n=2*getNumber(ColorType);
SetTag ColorDepth(n);
}
if(getNumber(Compression)==6)
{
n=4*getNumber(ColorType);
SetTag ColorDepth(n);
}
MetadataKey Filter(Compression, offset=0, size=1);
SetTag Filter_method(getNumber(Filter));
MetadataKey Interlace(Filter, offset=0, size=1);
SetTag Interlace_method(getNumber(Interlace));
}
if(getValue(chunkname)=="tEXt")
{
keyword=getStringByLink(chunkname,offset=0);
n=getLength(keyword);
datatext=getStringByLink(chunkname,offset=n+1);
if(keyword=="Title") SetTag Title(datatext);
if(keyword=="Author") SetTag Author(datatext);
if(keyword=="Description") SetTag Description(datatext);
if(keyword=="Copyright") SetTag Copyright(datatext);
if(keyword=="Creation Time") SetTag Creation_time(datatext);
if(keyword=="Software") SetTag Software(datatext);
if(keyword=="Disclaimer") SetTag Disclaimer(datatext);
if(keyword=="Warning") SetTag Warning(datatext);
if(keyword=="Source") SetTag Source(datatext);
if(keyword=="Comment") SetTag Comment(datatext);
}
oldlength=getNumber(length);
shift(length, 8+oldlength);
newlength=getNumber(length);
shift(chunkname, 8+oldlength);
shift(data, 12);
shift(crc, 8+newlength);
}
./2.png
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"145620";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1278429356";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"32";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"415";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"None";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"800";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
Generated PngEndAnalyzer by Translator:
./2.png
http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm
"6";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"145620";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1278429356";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator
":nwlrb";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"32";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"2.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"415";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"0";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"800";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact".
Extractor test:
myvector stores 7 numbers.
Name=Width Value = 800
Name=Height Value = 415
Name=Color_type Value = 8
Name=Compression_method Value = 6
Name=ColorDept Value = 32
Name=Filter_method Value = 0
Name=Interlace_method Value = 0
TFL input file:
Format Png;
Metadata: PngChunk;
if(PngChunk)
{
Width = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width";
Height = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height";
ColorDepth= "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth";
Compression_method = "http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm";
Interlace_method = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode";
Title="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#title";
Author="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator";
Description="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#description";
Copyright="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#copyright";
Creation_time="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentCreated";
Software="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#generator";
Dislaimer="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#disclaimer";
Warning="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment";
Source="http://www.semanticdesktop.org/ontologies/2007/05/10/nexif#model";
Comment="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment";
&type="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&fullname="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname";
&contactClass= "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact";
&rasterImage = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage";
Uri a;
T: a - type - contactClass;
T: a - fullname - Author;
D: type - rasterImage;
}
TL input file:
Binary PngChunk;
ByteOrder=MSB;
BitOrder=MSB;
StartMetadataKey MagicHex(offset=0, size=8);
checkKey(MagicHex)=0x89504e470d0a1a0a;
MetadataKey length(MagicHex, offset=0, size=4);
MetadataKey chunkname(length, offset=0, size=4);
MetadataKey data(chunkname, offset=0, size=getNumber(length));
MetadataKey crc(data, offset=0, size=4);
while(getValue(chunkname)!="IEND")
{
if(getValue(chunkname)=="IHDR")
{
MetadataKey width(chunkname, offset=0, size=4);
SetTag Width(getNumber(width));
MetadataKey height(width, offset=0, size=4);
SetTag Height(getNumber(height));
MetadataKey ColorType(height, offset=0, size=1);
SetTag Color_type(getNumber(ColorType));
MetadataKey Compression(ColorType, offset=0, size=1);
SetTag Compression_method(getNumber(Compression));
if(getNumber(Compression)==2)
{
n=3*getNumber(ColorType);
SetTag ColorDepth(n);
}
if(getNumber(Compression)==4)
{
n=2*getNumber(ColorType);
SetTag ColorDepth(n);
}
if(getNumber(Compression)==6)
{
n=4*getNumber(ColorType);
SetTag ColorDepth(n);
}
MetadataKey Filter(Compression, offset=0, size=1);
SetTag Filter_method(getNumber(Filter));
MetadataKey Interlace(Filter, offset=0, size=1);
SetTag Interlace_method(getNumber(Interlace));
}
if(getValue(chunkname)=="tEXt")
{
keyword=getStringByLink(chunkname,offset=0);
n=getLength(keyword);
datatext=getStringByLink(chunkname,offset=n+1);
if(keyword=="Title") SetTag Title(datatext);
if(keyword=="Author") SetTag Author(datatext);
if(keyword=="Description") SetTag Description(datatext);
if(keyword=="Copyright") SetTag Copyright(datatext);
if(keyword=="Creation Time") SetTag Creation_time(datatext);
if(keyword=="Software") SetTag Software(datatext);
if(keyword=="Disclaimer") SetTag Disclaimer(datatext);
if(keyword=="Warning") SetTag Warning(datatext);
if(keyword=="Source") SetTag Source(datatext);
if(keyword=="Comment") SetTag Comment(datatext);
}
oldlength=getNumber(length);
shift(length, 8+oldlength);
newlength=getNumber(length);
shift(chunkname, 8+oldlength);
shift(data, 12);
shift(crc, 8+newlength);
}
вторник, 3 августа 2010 г.
First results of test - bmp
Old bmpEndAnalyzer:
./test.bmp
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"921654";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280740186";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/bmp",
"image/bmp";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"24";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"480";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"640";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
Generated bmpEndAnalyzer by Translator:
./test.bmp
http://freedesktop.org/standards/xesam/1.0/core#formatSubtype
"Windows Bitmap";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"921654";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280740186";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/bmp",
"image/bmp";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"24";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"480";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"640";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
TFL input file:
Format Bmp;
Metadata: BmpInfoHeader;
if(BmpInfoHeader)
{
Type = "http://freedesktop.org/standards/xesam/1.0/core#formatSubtype";
Compression = "http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm";
Width = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width";
Height = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height";
Color = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth";
&rdftype = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&rasterImage = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage";
D: rdftype - rasterImage;
}
TL input file:
Binary BmpInfoHeader;
StartMetadataKey BM(offset=0, size=2);
checkKey(BM)="BM";
if(getString(BM)=="BM") SetTag Type("Windows Bitmap");
MetadataKey Width(start, offset=18, size=4);
SetTag Width(getNumber(Width));
MetadataKey Height(Width, offset=0, size=4);
SetTag Height(getNumber(Height));
MetadataKey BitCount(Height, offset=2, size=2);
SetTag Color(getNumber(BitCount));
MetadataKey Compression(BitCount, offset=0, size=4);
if(getNumber(Compression)==0) setTag Campression("None");
if(getNumber(Compression)==1) setTag Campression("RLE 8bit/pixel");
if(getNumber(Compression)==2) setTag Campression("RLE 4bit/pixel");
if(getNumber(Compression)==3) setTag Campression("Bit fields");
./test.bmp
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"921654";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280740186";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/bmp",
"image/bmp";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"24";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"480";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"640";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
Generated bmpEndAnalyzer by Translator:
./test.bmp
http://freedesktop.org/standards/xesam/1.0/core#formatSubtype
"Windows Bitmap";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"921654";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280740186";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/bmp",
"image/bmp";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"24";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"480";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"640";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
TFL input file:
Format Bmp;
Metadata: BmpInfoHeader;
if(BmpInfoHeader)
{
Type = "http://freedesktop.org/standards/xesam/1.0/core#formatSubtype";
Compression = "http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm";
Width = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width";
Height = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height";
Color = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth";
&rdftype = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&rasterImage = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage";
D: rdftype - rasterImage;
}
TL input file:
Binary BmpInfoHeader;
StartMetadataKey BM(offset=0, size=2);
checkKey(BM)="BM";
if(getString(BM)=="BM") SetTag Type("Windows Bitmap");
MetadataKey Width(start, offset=18, size=4);
SetTag Width(getNumber(Width));
MetadataKey Height(Width, offset=0, size=4);
SetTag Height(getNumber(Height));
MetadataKey BitCount(Height, offset=2, size=2);
SetTag Color(getNumber(BitCount));
MetadataKey Compression(BitCount, offset=0, size=4);
if(getNumber(Compression)==0) setTag Campression("None");
if(getNumber(Compression)==1) setTag Campression("RLE 8bit/pixel");
if(getNumber(Compression)==2) setTag Campression("RLE 4bit/pixel");
if(getNumber(Compression)==3) setTag Campression("Bit fields");
воскресенье, 1 августа 2010 г.
И даже работает...
Мы строили строили и наконец — запустили нормальный тест со стрижами, и даже что-то заработало.
Старый парсер выдает это для Png:
./test.png
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"49237";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280592673";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"8";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"450";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"None";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"600";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
Новый это:
./test.png
http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm
"3";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"49237";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280592673";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator
":nwlrb";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"8";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"450";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"0";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"600";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact".
Не в десятку, но это уже минус входного файла — нужно сесть и все по-человечески доделать. Есть еще недоделки(большие и не очень) и баги, но тут два позитивных момента 1) я о них знаю 2) по ходу все можно доделать/исправить — не смертельно. Ура, начинаем тесты!!!!
Старый парсер выдает это для Png:
./test.png
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"49237";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280592673";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"8";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"450";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"None";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"600";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
Новый это:
./test.png
http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm
"3";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"49237";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280592673";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/png",
"image/png";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#creator
":nwlrb";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"8";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.png";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"450";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#interlaceMode
"0";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"600";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".
:nwlrb
http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname
"";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact".
Не в десятку, но это уже минус входного файла — нужно сесть и все по-человечески доделать. Есть еще недоделки(большие и не очень) и баги, но тут два позитивных момента 1) я о них знаю 2) по ходу все можно доделать/исправить — не смертельно. Ура, начинаем тесты!!!!
Подписаться на:
Сообщения (Atom)