【发布时间】:2014-10-31 20:17:02
【问题描述】:
我正在尝试获取所有维基百科人员的列表,这些人员具有尽可能多的功能来解决某些机器学习问题。
我已经设置了本地 DBPedia 服务器,并且已经增加了各种参数的限制,但不知何故我仍然无法获得所需的结果。
所需的输出是以下格式的 CSV:
<Person1>,<Feature1>,<Feature2>,<Feature3> .......... and so on
<Person2>,<Feature1>,<Feature2>,<Feature3> .......... and so on
<Person3>,<Feature1>,<Feature2>,<Feature3> .......... and so on
...and
...so
...on
有人可以指导我正确的方法吗?
例如,当我运行这个查询时,我得到了blank 结果:
查询:
SELECT ?name ?birthDate WHERE {
{
SELECT strafter(str(?person),"http://dbpedia.org/resource/") as ?name, str(?
birthDate) as ?birthDate WHERE {
?person a <http://dbpedia.org/ontology/Person> .
?person dbpedia-owl:birthDate ?birthDate .
}
ORDER BY ASC(?name)
}
}
OFFSET 100000
LIMIT 500
结果: [[姓名]][[出生日期]]
但是当我运行这个查询时,我只得到了 50000 的行数,这非常少
查询:
SELECT strafter(str(?person),"http://dbpedia.org/resource/") as ?name, str(?birthDate)
as ?birthDate, str(?birthName) as ?birthName, strafter(str(?
occupation),"http://dbpedia.org/resource/") as ?occupation WHERE {
?person a <http://dbpedia.org/ontology/Person> .
?person dbpedia-owl:birthDate ?birthDate .
?person dbpedia-owl:birthName ?birthName .
?person dbpedia-owl:occupation ?occupation .
}
结果: >
奇怪的是,这个查询似乎有效(至少达到了一个不错的数字)-
查询:
select ?s ?p ?o { ?s a dbpedia-owl:Person ; ?p ?o }
结果: >
我的 virtuoso.ini 文件:
[Database]
DatabaseFile = /var/lib/virtuoso/db/virtuoso.db
ErrorLogFile = /var/lib/virtuoso/db/virtuoso.log
LockFile = /var/lib/virtuoso/db/virtuoso.lck
TransactionFile = /var/lib/virtuoso/db/virtuoso.trx
xa_persistent_file = /var/lib/virtuoso/db/virtuoso.pxa
ErrorLogLevel = 7
FileExtend = 200
;MaxCheckpointRemap = 2000
MaxCheckpointRemap = 1362500
Striping = 0
TempStorage = TempDatabase
[TempDatabase]
DatabaseFile = /var/lib/virtuoso/db/virtuoso-temp.db
TransactionFile = /var/lib/virtuoso/db/virtuoso-temp.trx
MaxCheckpointRemap = 2000
Striping = 0
[Parameters]
ServerPort = 1111
LiteMode = 0
DisableUnixSocket = 1
DisableTcpSocket = 0
;SSLServerPort = 2111
;SSLCertificate = cert.pem
;SSLPrivateKey = pk.pem
;X509ClientVerify = 0
;X509ClientVerifyDepth = 0
;X509ClientVerifyCAFile = ca.pem
ServerThreads = 20
CheckpointInterval = 60
O_DIRECT = 0
CaseMode = 2
MaxStaticCursorRows = 500000000
CheckpointAuditTrail = 0
AllowOSCalls = 0
SchedulerInterval = 10
DirsAllowed = ., /usr/share/virtuoso/vad, /usr/local/data/datasets
ThreadCleanupInterval = 0
ThreadThreshold = 10
ResourcesCleanupInterval = 0
FreeTextBatchSize = 100000
SingleCPU = 0
VADInstallDir = /usr/share/virtuoso/vad/
PrefixResultNames = 0
RdfFreeTextRulesSize = 100
IndexTreeMaps = 256
MaxMemPoolSize = 200000000
PrefixResultNames = 0
MacSpotlight = 0
IndexTreeMaps = 64
MaxSortedTopRows = 100000000
;;
;; Uncomment next two lines if there is 64 GB system memory free
NumberOfBuffers = 5450000
MaxDirtyBuffers = 4000000
;;
[HTTPServer]
ServerPort = 8890
ServerRoot = /var/lib/virtuoso/vsp
ServerThreads = 20
DavRoot = DAV
EnabledDavVSP = 0
HTTPProxyEnabled = 0
TempASPXDir = 0
DefaultMailServer = localhost:25
ServerThreads = 10
MaxKeepAlives = 10
KeepAliveTimeout = 10
MaxCachedProxyConnections = 10
ProxyConnectionCacheTimeout = 15
HTTPThreadSize = 280000
HttpPrintWarningsInOutput = 0
Charset = UTF-8
;HTTPLogFile = logs/http.log
[AutoRepair]
BadParentLinks = 0
[Client]
SQL_PREFETCH_ROWS = 100
SQL_PREFETCH_BYTES = 16000
SQL_QUERY_TIMEOUT = 0
SQL_TXN_TIMEOUT = 0
;SQL_NO_CHAR_C_ESCAPE = 1
;SQL_UTF8_EXECS = 0
;SQL_NO_SYSTEM_TABLES = 0
;SQL_BINARY_TIMESTAMP = 1
;SQL_ENCRYPTION_ON_PASSWORD = -1
[VDB]
ArrayOptimization = 0
NumArrayParameters = 10
VDBDisconnectTimeout = 1000
KeepConnectionOnFixedThread = 0
[Replication]
ServerName = db-IP-172-31-24-242
ServerEnable = 1
QueueMax = 5000000
[Striping]
Segment1 = 100M, db-seg1-1.db, db-seg1-2.db
Segment2 = 100M, db-seg2-1.db
;...
[Zero Config]
ServerName = virtuoso (IP-172-31-24-242)
[URIQA]
DynamicLocal = 0
DefaultHost = localhost:8890
[SPARQL]
;ExternalQuerySource = 1
;ExternalXsltSource = 1
;DefaultGraph = http://localhost:8890/dataspace
;ImmutableGraphs = http://localhost:8890/dataspace
;ResultSetMaxRows = 10000
ResultSetMaxRows = 1000000000
;MaxQueryCostEstimationTime = 400 ; in seconds
MaxQueryCostEstimationTime = 4000000000000000 ; in seconds
;MaxQueryExecutionTime = 60 ; in seconds
MaxQueryExecutionTime = 600000000000000 ; in seconds
DefaultQuery = select distinct ?Concept where {[] a ?Concept} LIMIT
100
DeferInferenceRulesInit = 0 ; controls inference rules loading
;PingService = http://rpc.pingthesemanticweb.com/
MaxSortedTopRows = 10000000
[Plugins]
LoadPath = /usr/lib/virtuoso/hosting
Load1 = plain, wikiv
Load2 = plain, mediawiki
Load3 = plain, creolewiki
Load4 = plain, im
请告诉我,以防我遗漏了一些琐碎的事情,但这些查询的结果对我来说没有意义。
【问题讨论】:
标签: rdf sparql semantic-web dbpedia virtuoso