如何采取一些特殊的字符串形式sparql

时间:2017-05-21 07:21:48

标签: php sparql

我有这段代码:

                var permissionCheck : File; 
                permissionCheck  = new File(pdfFile.nativePath);
                permissionCheck.addEventListener(PermissionEvent.PERMISSION_STATUS , function permissionStatusHandler( e : PermissionEvent ) :void
                {                        
                    permissionCheck.removeEventListener(PermissionEvent.PERMISSION_STATUS , permissionStatusHandler);
                    if(e.status == PermissionStatus.GRANTED)
                    {                            
                        //  save your file
                        pdfFolder = File.userDirectory.resolvePath(".Folder");
                        if(!pdfFolder.exists)
                            pdfFolder.createDirectory();
                        trace(pdfFolder.nativePath);
                        //pdfFile =  File.applicationStorageDirectory.resolvePath("pdf/" +file);
                        var targetFile:File = File.userDirectory.resolvePath(".Folder/" +file);
                        trace(targetFile.nativePath);
                        if(targetFile.exists)
                            targetFile.deleteFile();

                        if(!targetFile.exists && pdfFile.exists)
                        {
                            try
                            {
                                pdfFile.copyTo(targetFile);
                                Template.showFile(targetFile.nativePath);
                            }
                            catch(error:Error)
                            {
                                Popup.showMessage("PDF Viewer", "Unable to open " + file + ". File does not exists. " + error.message);
                                trace("Error:" + error.message);
                            }
                        }
                        else
                        {
                            Popup.showMessage("PDF Viewer", "Unable to find " + file + ". File does not exists.");
                        }

                    }
                    else
                    {
                        //showPermissionError();
                        trace("Error"+ pdfFolder.nativePath);

                    }

                });

                try
                {
                    permissionCheck.requestPermission();

                }
                catch(error : Error)
                {
                    trace("Error:" + error.message);
                }

            }

我得到了这个输出: enter image description here

如何从上面的输出中获取特定字符串, 谢谢您的帮助 最好的考虑

1 个答案:

答案 0 :(得分:0)

您可以使用str函数获取RDF文字的词法形式:

PREFIX : <http://www.semanticweb.org/user/ontologies/2016/karya_ilmiah#>
SELECT  (str(?judulNaskahLit) AS ?judulNaskah) (str(?linkNaskahLit) AS ?linkNaskah)
WHERE {
  ?naskah  :judulNaskah  ?judulNaskahLit
  FILTER regex(str(?judulNaskahLit), "Sistem Informasi Manajemen")
  ?naskah  :linkNaskah  ?linkNaskahLit
}
ORDER BY ?judulNaskah